adding row to SQL DB

Bufffluopsy

New Member
I'm new with .net and I'm not enjoying it so please take it easy with me. I have a scenario where I'm going through a series of forms and getting information. At the end of the forms I need to add the information to a table in my db. I don't have a datagrid that I'm using for this nor am I using a dataset. Can someone point me to an example for adding a new record without a datagrid or dataset? Or, do I have to have a dataset? If so, then how do I get my form variables to fill in my dataset? I'm totally lost on this.<BR>Thanks,<BR>RickiBasically, use a Command Object with the ExecuteNonQuery Method:<BR><BR><BR>string strConn = ConfigurationSettings.AppSettings["MyConn"];<BR>string strSQL = "INSERT INTO tbl...." //Your Insert Statement Here<BR>OleDbConnection objConn = new OleDbConnection(strConn);<BR>OleDbCommand objCmd = new OleDbCommand(strSQL, objConn);<BR>objConn.Open();<BR>objCmd.ExecuteNonQuery();<BR>objConn.Close();<BR>objConn.Dispose();<BR>
 
Back
Top