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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how to study PHP my own? i reffered many sites.. but as being a fresher i couldnt follow those... which site will be the best one?

1845


suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

1494


how CLR identify vb file?

2500


what is the diffrence between software and hardware language?

1823


Hello...has anyone interviewed with Information Management Services(IMS)located in Silver Spring MD??If yes,what can you share about the programming test and the analytical test?

1505






Define distributed queries. can you explain me as soon as possible

1626


what are the missinschema properties and should we pass primary key in select command

1417


It is possible to take number of controls added to form at run-time.ex-when user enter 6, 6 text boxes get added to form,next time number of controls get change as per user number enter. What is code for that?

1508


How to connect the .accdb database file of microsoft access to the Visual Basic 6.0 forms?

3702


can we allocate memory for interface? if no then why?

1468


Explain polymorphism. Provide an example.

618


How to know we are in home page of a web application using QTP

2002


is it possible to desable particular parameter of the normal orcle report based on some condition ?????? if yes,wht is the function for desabling a parameter...

1581


i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..

2886


can any one suggestion me present which course(except java,.net) has huge demand in the market?

1617