Hi
How to create a New user using sql server 2005 using c#
i need to create the New user by using the requirements
USERNAME ------------------ TEXTBOX
PASSWORD-------------------TEXTBOX
CONFIRM PASSWORD--------------TEXTBOX
AUTHENTICATIO--------------------COMBOBOX
OK------------------------BUTTON
CANCEL--------------------BUTTON
And if i click on ok it should connect to database and update the new username and password.........
Please help me regarding this...................
Loading
Krishna GaradPosted Feb 9, 2012, 4:11 AM
private void Insert()
{
SqlConnection cn=new SqlConnection("Your String);
SqlCommand cmd=new SqlCommand("Insert Into YourTable(UserName,Password,Authentication)Values('"+txtuname.text+"','"+txtpwd.Text
+"','"+combobox.SelectedItem.Text+"')",cn);
cn.Open();
int _records=cmd.ExecuteNonQuery();
cn.Close();
}
if it is update then change the command like update table set column=value like you can.