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

Find out the list of authorization objects which contains activity as a field? Thanks in advance.

0 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,


What is the difference between in-proc and out-of-proc?

2 Answers   Oracle,


Given a arbitrary pointer to an element in a singly linked list?what is the time complexity for its deletion .

1 Answers   Hughes,


Do not use more than 3 nested IF. Use Evaluate statement in case of more IF required. Please give a detail explantion besides readability and clarity for Evaluate stmt.

0 Answers  


in a company 30% are supervisors and 40% employees are male if 60% of supervisors are male. what is the probability that a randomly choosen employee is a male or female?need steps to solve this?

1 Answers   TCS,


How many packages available in java??

7 Answers   CTS,


what is microprocessor?

1 Answers   HCL,


how MATLSB software suitable for electrical branch? which tools are useful??

1 Answers  


What is Boxing?

3 Answers  


What function would you use to extract characters from a given string?

2 Answers  


Write a program to find factorial of a number using functions

0 Answers   Peerless,


Categories