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

what is the difference between conversion and interface in bdc?

1 Answers  


Why COBOL/400 is giving 95 session error when opening a file even though the file is having key and the screen or display file is having IND ARA defined?

1 Answers   Freelance,


how do i add a column dynamically in a table by using java application?

0 Answers  


WHAT IS MAIN IMPORTANT THING IN SOFTWARE?

0 Answers   Infosys,


In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  






Difference of Console, web & windows applications?

0 Answers  


what are the topics choosen for jam round for interviews

0 Answers  


if there are n nodes in a binary tree, how many null pointers are there?

4 Answers   Hughes,


how to add Servlet-api.jar file into eclipse 3.3.2 ?

0 Answers   IBM,


What binary value will be internally stored for NULL for the type S9(1) COMP 3 in mainframe

0 Answers  


Difference between abstract class and Interfaces in Java

9 Answers   Nest, Persistent, Yantro Software,


Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.

0 Answers  


Categories