Moti Mashiah
asked on
C# update
Hi guys ,
I'm trying to update just one column and I got error see screenshot (app) and also see attachment of my table.
here is my code:
app.JPG
I'm trying to update just one column and I got error see screenshot (app) and also see attachment of my table.
here is my code:
string Query = "update rmsmasterdbtest.dbo.serial set serialnumber='" + this.txtsn.Text + "' ,serialnumber3='" + this.txtstatus + "' where serialnumber='" + this.txtsn.Text + "' ;";
database.JPGapp.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I read some material but still get complicated when I'm trying to write update code.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for motimash's comment #a39994534
Assisted answer: 500 points for carl_tawn's comment #a39994409
for the following reason:
Thanks
Accepted answer: 0 points for motimash's comment #a39994534
Assisted answer: 500 points for carl_tawn's comment #a39994409
for the following reason:
Thanks
ASKER
Excellent as usual
ASKER
Carl , it seems that any time I'm trying to update I got some issue I think that I'm not really understand the concept updating database columns can you give my some explanation also I would like to now what is the difference between these two update methods
1.
Open in new window
2.
string Query = "update rmsmasterdbtest.dbo.serial
SqlConnection Myconn = new SqlConnection(conn);
SqlCommand cmd = new SqlCommand(Query, Myconn);
SqlDataReader Reader;
try
{
Myconn.Open();
Reader = cmd.ExecuteReader();
MessageBox.Show("Updated Status");
while (Reader.Read())
{
}
Thank you soo much