c# - Saving Insertions into a database -
i updating database using c# & sql. when insert value table exists in table until close connection. how save values inserted? here code using:
conn = new system.data.sqlclient.sqlconnection(); conn.connectionstring = "data source=.\\sqlexpress; attachdbfilename=|datadirectory|\\unmapped.mdf;integrated security=true;user instance=true"; string sql = "insert unmappedteamstable values ('value1', 'value2', 'pw')"; sqlcommand insertcommand = new sqlcommand(sql, conn); conn.open(); insertcommand.executenonquery(); conn.close();
thanks
set brakepoint , see if query running or not.
i think code not executing properly.
Comments
Post a Comment