how do you generate source code for the automatic generation
for receipt number



how do you generate source code for the automatic generation for receipt number..

Answer / raviarsenal

C # in form load paste this code


try
{
SqlConnection con = new SqlConnection
(@"Data Source=.\sqlexpress;Initial
Catalog=Hospital;Integrated Security=True");
con.Open();
q = "select Billno from PatientBill";
SqlCommand cmd = new SqlCommand(q, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
bill = Convert.ToInt32(dr
["Billno"].ToString());
}
txtbillno.Text = (bill + 1).ToString();
dr.Close();
cmd.Dispose();
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

Even if all fields are initialized also in a program, I am getting COBOL/400 decimal data error .why is it coming?

1 Answers   Freelance,


3. . Explain the Cache memory? What is the advantage of a processor having more cache memory?

1 Answers  


what is class module in vb6? what it's use? with example..

0 Answers  


is it acceptable if we declare multiple exceptions in same overridden method.

0 Answers  


what is posix?

1 Answers   HCL,






What is diffrent between Method and and function in c#

0 Answers  


kindly send interview materials

0 Answers   SoftSquare,


how we can connect applet with database?

1 Answers  


what is the current salary package in India for a lamp programmer

0 Answers   HCL,


what is polymorphism in java.

3 Answers   Atos Origin,


Explain the types of operations? Draw the figure for shift and rotate operations?

0 Answers  


I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!

0 Answers  


Categories