Problem in Update Btn Click .......... pls help me [modified]
-
public static bool UpdateVisitor(string id,string n, string c, decimal p) { drow = ds.Tables[0].Rows.Add(); drow[0] = id; drow[1] = n; drow[2] = c; drow[3] = p; vda.UpdateCommand = vcb.GetUpdateCommand(); int res = vda.Update(ds.Tables[0]); if (res > 0) { System.Windows.Forms.MessageBox.Show("Visitor Details Updated"); return true; } else return false; } i am new. pls tell me what is wrong. i want to update the data ok.......... thanks in advance
modified on Friday, September 25, 2009 1:27 AM
-
public static bool UpdateVisitor(string id,string n, string c, decimal p) { drow = ds.Tables[0].Rows.Add(); drow[0] = id; drow[1] = n; drow[2] = c; drow[3] = p; vda.UpdateCommand = vcb.GetUpdateCommand(); int res = vda.Update(ds.Tables[0]); if (res > 0) { System.Windows.Forms.MessageBox.Show("Visitor Details Updated"); return true; } else return false; } i am new. pls tell me what is wrong. i want to update the data ok.......... thanks in advance
modified on Friday, September 25, 2009 1:27 AM
New to the site, or new to C# ? If you're new to C#, then why are you writing this code ? I assume you're writing for learning purposes, there is no way you're writing production quality code. So, choose a simpler task, and learn your way up to what ever task it is you're trying to learn how to do. And, when you ask questions, don't say 'what is wrong'. Tell us what you want the code to do, what it does instead, what your efforts at debugging have told you already, etc.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
public static bool UpdateVisitor(string id,string n, string c, decimal p) { drow = ds.Tables[0].Rows.Add(); drow[0] = id; drow[1] = n; drow[2] = c; drow[3] = p; vda.UpdateCommand = vcb.GetUpdateCommand(); int res = vda.Update(ds.Tables[0]); if (res > 0) { System.Windows.Forms.MessageBox.Show("Visitor Details Updated"); return true; } else return false; } i am new. pls tell me what is wrong. i want to update the data ok.......... thanks in advance
modified on Friday, September 25, 2009 1:27 AM
Are u getting any error or what? Whats ur problem? :^) I hav few more Qs. 1) Where r u defining ur dataset "ds"? 2) Why u want ur return type Static?
-
Are u getting any error or what? Whats ur problem? :^) I hav few more Qs. 1) Where r u defining ur dataset "ds"? 2) Why u want ur return type Static?
I love it when they ask dumb questions, and when you try to help, they never answer.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I love it when they ask dumb questions, and when you try to help, they never answer.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
:laugh: Its their loss. :laugh:
-
I love it when they ask dumb questions, and when you try to help, they never answer.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
He asked the same question a couple of days ago. I can't remember, nor can I be bothered to check, if he got an answer then.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”