Click here to Skip to main content
15,896,557 members

Comments by faizy001 (Top 12 by date)

faizy001 2-Mar-23 2:09am View    
sir i have seen this example but this time i want to Bind a List or collection
faizy001 22-May-17 2:14am View    
thank you :)
faizy001 2-May-17 7:34am View    
sir this is very important for me please solve the problem
faizy001 2-May-17 7:33am View    
hello sir . i applied this codes like that but it is not working . please check where . am wrong


SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=DelhiEMP;Integrated Security=True");
con.Open();
string query1 = "insert into countermaster2(code, name, type) values(@code, @name, @type)";
SqlCommand cmd = new SqlCommand(query1,con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
cmd.Parameters.AddWithValue("@code", comboBox2.SelectedItem);
cmd.Parameters.AddWithValue("@name", textBox2.Text);
cmd.Parameters.AddWithValue("@type", comboBox1.SelectedItem);

if (ds.Tables["countermaster2"].Rows.Count>0)
{
MessageBox.Show("Code is already exsist");
}
else
{
MessageBox.Show("enter new records");
}



cmd.ExecuteNonQuery();


MessageBox.Show("Saved");
faizy001 2-May-17 2:40am View    
sir i want to my code should be run properly. i have tried many times but still not working. please do my code in correct format .