0
Dont no if you looking for this but this is a basic add func.
public bool addUser(string argUsername, string argPassword, string argStatus, int argCusID, ref string msg)
{
string sql = "INSERT INTO LOGIN " +
" (UserName,Password,Status,Cust_ID) " +
" VALUES " +
" ('" + argUsername + "','" + argPassword + "','" + argStatus + "','"+ argCusID + "')";
bool insertState = false;
conn = new SqlConnection(connString);
cmd = new SqlCommand(sql,conn);
da = new SqlDataAdapter(cmd);
try
{
conn.Open();
cmd.ExecuteNonQuery();
//sets insertstate to true if insert was successfull
insertState = true;
}
catch (Exception ex)
{
msg = ex.Message;
}
conn.Close();
return insertState;
}
0
Hi
Use the classes OleDbConnection, OleDbCommand, OleDbDataAdapter, respectivly sql versions of the connection, command and data adapter.
Simon