|
Have you gone through the article whose link I have given you earlier?
Apurva Kaushal
|
|
|
|
|
problem with this code snippet
init(){
service.useService("http://localhost/CursoAspNetWebService/Service1.asmx?WSDL",_
"Service1");
}
|
|
|
|
|
What is the problem you are getting on this? Any error message?
Apurva Kaushal
|
|
|
|
|
while invoking web service in application
function callService()
{
Samples.AspNet.Service.sum();
}
Here Service is my webservice and sum is the function in it..
while running am getting error like "Sample" is undifined..
|
|
|
|
|
shru_09 wrote: i failing in calling that webservice in client side...
What is the error? What difficulty are you running into?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Hey
I have the following code
for (int x = 0; x < GridView4.Rows.Count; x++)
{
GridViewRow row = GridView4.Rows[x];
bool isCheckedIgnore = ((CheckBox)row.FindControl("chkIgnoreItem")).Checked;
if (isCheckedIgnore == true)
<b>now what it should do is perform an action when isCheckedComponentIgnore is false</b>
but it doesnt do that, the interesting thing is, is that the chkIgnoreitem is a column in a gridview which was ticked or unticked depending on a field in a database, I recently changed the field from format 1 or 0 to Y or N
does anyone know why this wouldn't work?
thanks!
|
|
|
|
|
Make the field in the database a bit-field
or
((CheckBox)row.Cells[x].Controls[0]).Checked
where x is the 0-based columnnumber
|
|
|
|
|
digimanus wrote: or
((CheckBox)row.Cells[x].Controls[0]).Checked
where x is the 0-based columnnumber
Yeah but I need to find all checkboxes which are ticked in order to perform the users request, a user can tick and untick a box
thanks anyway
|
|
|
|
|
if you lookad at you own code then you see your run a for-loop
place my code in your for loop!
|
|
|
|
|
bool isCheckedIgnore = ((CheckBox)row.FindControl("chkIgnoreItem")).Checked;
this will always return true coz u r by default giving value as checked
i think this is the reason for that if not please let me know
|
|
|
|
|
I can't change the field to bit, it needs to stay as nvarchar.
rajkumar.3 wrote: this will always return true coz u r by default giving value as checked
Im not sure on that because its finding the control and setting isCheckedIgnore to the result of that, therefore if the textbox is not ticked it should skip the first statement below and do the second
if (isCheckedComponentIgnore == true)
{
}
else
{
}
|
|
|
|
|
ok slightly seperate problem but related
ive got the following code which is binding data which is not a bit field but a varchar and contains Y or N in the column. The code below produces the error:
"Specified cast is not valid."
stringvalue = (bool)DataBinder.Eval(e.Row.DataItem, "fieldname");
however if I change the column to bit i.e. 1 and 0 it works.
Is there a way I can change the code so that it works without changing the column to 1 and 0 i.e. bit!
cheers
|
|
|
|
|
for (i=1;i=5;i++)
{
int a=i;
sqlinsert="update tbl_name set loop_no=a where rollnumber=a";
cmd = new SqlCommand(sqlinsert, conn);
try
{
cmd.ExecuteNonQuery();
}
catch(Exception ex)
{
FileStream fs;
StreamWriter sw;
fs=new Filestream("logfile.txt",FileMode.open);
sw=new StreamWriter(fs);
string newline="Roll No:"+a+"was not updated";
sw.close();
fs.close();
}
}
once if its go for "CATCH" block, how it can proceed others?
i.e, if record 2 fails, will it proceed other records and complete the whole FOR loop????
i tried.. but getting error...
how to achieve it?
thanks in advance and understanding....
|
|
|
|
|
Since this is not VB6 and you cannot Resume Next On Error, I guess you better validate what you're updating before trying to update it, and if it doesn't validate, not try to update. Simply. Thus, you get no exceptions and the for loops for as long as you want it to loop
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
|
|
|
|
|
John Sundar wrote:
once if its go for "CATCH" block, how it can proceed others?
i.e, if record 2 fails, will it proceed other records and complete the whole FOR loop????
The try/catch block is within the body of the loop. If an error occurs during one iteration of the loop, it will be caught and the code will proceed to subsequent iterations.
John Sundar wrote: i tried.. but getting error...
You need to post details of the error if you want help. We're not mindreaders.
John Sundar wrote: how to achieve it?
Post details of your error, and maybe you'll get some help.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
how to use the date concept in .net with C#
|
|
|
|
|
, obviously hasnt read any of the posts on this page about using google for questions
|
|
|
|
|
In his previous post itself it was mentioned that these questions can be answered easily on google.
Apurva Kaushal
|
|
|
|
|
nithydurai wrote: how to use the date concept
Please be more clear. I observe that variants of this question is scattered across the forum aplenty. Posting the same query multiple times actually dissuades focussed experts in helping out rendering your request futile.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
i am using date concept.i get system date.but i host the project in website.it will be run.i am using the query select * from tablename where date='"+systemdate+"'.i have one dought i donot open website,how it's run.it will run or not.if you know the answer replay to me..
|
|
|
|
|
Can you write your question in somewhat better manner. It is not at all clear what you want to ask.
Apurva Kaushal
|
|
|
|
|
i am using --->
string month, yearr, datee, systemdate;
month = DateTime.Now.Month.ToString();
yearr = DateTime.Now.Year.ToString();
datee = DateTime.Now.Day.ToString();
systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString());
SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;");
con.Open();
SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con);
cmd.ExecuteNonQuery();
con.Close();
this is my code. systemdate reach the date it will be delete.but i host the project in web.how it is work?
replay to me...
|
|
|
|
|
sugunavathysubramanian wrote: string month, yearr, datee, systemdate;
month = DateTime.Now.Month.ToString();
yearr = DateTime.Now.Year.ToString();
datee = DateTime.Now.Day.ToString();
systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString());
SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;");
con.Open();
SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con);
cmd.ExecuteNonQuery();
con.Close();
Buy a basic programming book, there are so much chaff in the above that it is impossible to guide you.
eg.
Convert.ToString(yearr.ToString()); <-- anything strike you as redundant in this snippet?
|
|
|
|
|
sugunavathysubramanian wrote: new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;");
Your database administrator should really be kicked with a wet towel till he understands the folly he has created:
1) Allowing others to tamper the master database
2) Having a weak password for sa account.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|