Code:
string strQuery = "INSERT INTO Table1(FirstName , LastName , Age) Values ( '{0}' , '{1}' , {2} ) "; strQuery = string.Format(strQuery , txt_FirstName.Text , txt_LastName.Text , Convert.Toint32(txt_Age.Text)); and Ten you can use strCommand in function like DoCommand(strQuery); using system.data.sqlclient; // imports sqlclient on top of your form or
Leave a comment: