Simple marketing Program

R

Rohan

Guest
I have homework to create this program:


but I have no idea how to work with data grid view rows. I can show the data from the SQL Server but I cannot work with them. I was only able to show the data and create the invoice id but it does not increase it just stay the same number.

This is my program now:


and that is the code I have tried.

This is my database


con.Open();

SqlCommand cmd = new SqlCommand("select max (Invoice_ID)+1 from Table_Order", con);

SqlDataReader dr = cmd.ExecuteReader();
if ( dr.HasRows )
{
while ( dr.Read() )
{
textBox1.Text = dr[0].ToString();
if ( textBox1.Text == "" )
{
textBox1.Text = "1";
}
}
}
else
{
textBox1.Text = "1";
}

con.Close();


If anyone can help me any source code or some videos that are good for my program I would be thankful.

Continue reading...
 
Top