private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(conString);
con.Open();
int tableID;
int customerID;
customerID = Convert.ToInt32(dataGridView2.SelectedCells[0].Value.ToString());
tableID = Convert.ToInt32(dataGridView1.SelectedCells[0].Value.ToString());
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from Reservationn where TableID='" + tableID+ "CustomerID='"+ customerID +"Capacity='" + textBox2.Text + "Date='"+textBox5.Text+"HourEnd='"+comboBox1.Text+"Reservİnfo='"+textBox6.Text + "'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dataGridView3.DataSource = dt;
con.Close();
}
Es gibt ein Problem in:Wie kann SQL-Abfrage für ein weiteres Datum geschrieben werden?
cmd.CommandText = "select * from Reservationn where TableID='" + tableID+ "CustomerID='"+ customerID +"Capacity='" + textBox2.Text + "Date='"+textBox5.Text+"HourEnd='"+comboBox1.Text+"Reservİnfo='"+textBox6.Text + "'";
Wie kann es behoben werden?
was genau ist dein Problem? (außer Plutonix Kommentar) –