I developed a Windows Based Application and installed the setup.exe created by using VS C#2.0 on other PC to check accuracy , after properly installing the application on Windows Vista it successfully established the connection to SQL Server 2005. There are many form in this application viz;
'New Order', 'Generate Bill', 'Final Payment' and 'Purchase Details' etc. When I enter data by using the
'Purchase Details' form, data successfully submitted to database, but when I enter data by using the
'New Order' form and click the submit button the application stops working immediately and gives an error message as like:-
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: billing_software.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 522ed0d8
Problem Signature 04: System.Data
Problem Signature 05: 2.0.0.0
Problem Signature 06: 49cc5f1a
Problem Signature 07: 2492
Problem Signature 08: 2c
Problem Signature 09: System.Data.SqlClient.Sql
OS Version: 6.0.6002.2.2.0.768.2
Locale ID: 16393
Read our privacy statement:
http:
I am giving herewith the New Order Submit button code sample:-
private void button1_Click(object sender, EventArgs e)
{
string s = "insert into New_Order values('" + comboBox1.Text + "','" + comboBox2.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + dateTimePicker1.Value + "','" + dateTimePicker2.Value + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','" + textBox8.Text + "')";
SqlConnection con = new SqlConnection(Class1.cs);
con.Open();
SqlCommand cmd = new SqlCommand(s, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Information Saved Successfully");
textBox3.Text = "";
comboBox2.Text = "";
textBox1.Text = "";
textBox4.Text = "";
textBox2.Text = "";
dateTimePicker1.Text = "";
dateTimePicker2.Text = "";
textBox5.Text = "";
textBox6.Text = "";
textBox7.Text = "";
textBox8.Text = "";
con.Close();
string s1 = "select * from Sales_Details where Challan_No='" + comboBox1.Text + "'";
SqlConnection cn = new SqlConnection(Class1.cs);
cn.Open();
SqlDataAdapter da = new SqlDataAdapter(s1, cn);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
cn.Close();
}
I am not finding the reason behind it, pleasesomeone help me.