[SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] inserttable()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]com.CommandType = [/SIZE][SIZE=2][COLOR=#008080]CommandType[/COLOR][/SIZE][SIZE=2].StoredProcedure;[/SIZE]
[SIZE=2]com.CommandText = [/SIZE][SIZE=2][COLOR=#800000]"insertshahid"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#0000ff]try[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]com.Connection = con;[/SIZE]
[SIZE=2]con.Open();[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@sname"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 20);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@sname"[/COLOR][/SIZE][SIZE=2]].Value = sname.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@lastname"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 50);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@lastname"[/COLOR][/SIZE][SIZE=2]].Value = lastname.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@fname"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 20);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@fname"[/COLOR][/SIZE][SIZE=2]].Value = fname.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@snumber"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 10);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@snumber"[/COLOR][/SIZE][SIZE=2]].Value = snumber.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@bdate"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 10);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@bdate"[/COLOR][/SIZE][SIZE=2]].Value = blate.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@ldate"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 10);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@ldate"[/COLOR][/SIZE][SIZE=2]].Value = ldate.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@place"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 50);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@place"[/COLOR][/SIZE][SIZE=2]].Value = place.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@grade"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 20);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@grade"[/COLOR][/SIZE][SIZE=2]].Value = vazgrade();[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@study"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 30);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@study"[/COLOR][/SIZE][SIZE=2]].Value = study.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@tahol"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].Int);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@tahol"[/COLOR][/SIZE][SIZE=2]].Value = vaztahol();[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@swork"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 50);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@swork"[/COLOR][/SIZE][SIZE=2]].Value = swork.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@address"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 50);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@address"[/COLOR][/SIZE][SIZE=2]].Value = address.Text;[/SIZE]
[SIZE=2]com.Parameters.Add([/SIZE][SIZE=2][COLOR=#800000]"@phone"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#008080]SqlDbType[/COLOR][/SIZE][SIZE=2].NVarChar, 12);[/SIZE]
[SIZE=2]com.Parameters[[/SIZE][SIZE=2][COLOR=#800000]"@phone"[/COLOR][/SIZE][SIZE=2]].Value = phon.Text;[/SIZE]
[SIZE=2]com.ExecuteNonQuery();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]catch[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#008080]Exception[/COLOR][/SIZE][SIZE=2] ex)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#008080]DialogResult[/COLOR][/SIZE][SIZE=2] d = [/SIZE][SIZE=2][COLOR=#008080]MessageBox[/COLOR][/SIZE][SIZE=2].Show(ex.Message);[/SIZE]
[SIZE=2]result = 2;[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]finally[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]con.Close();[/SIZE]
[SIZE=2]result = 1;[/SIZE]
[SIZE=2]sname.Text = lastname.Text = fname.Text = snumber.Text = blate.Text = ldate.Text = place.Text = study.Text = swork.Text = address.Text = phon.Text = tahol.Text = grade.Text = [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]