well its pretty much the exact same code for a windows form, the calls to SQL server are irralavant to the fact that its win forms or a web app. you still need a :
Connection Object
Command Object
Parameters
Execution block
hth,Code:using(SqlConnection conn = new SqlConnection(ConfigruationManager.ConnectionStrings["myConStr"])){ SqlCommand cmd = new SqlCommand("INSERT STATEMENT", conn); cmd.Parameters.AddWithValue("@myParm1",Value1); .... try{ conn.open(); cmd.ExecuteNonQuery(); conn.close() } catch(SqlException ex){ throw(ex); } }
mcm
}




Reply With Quote