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

Answers were Sorted based on User's Feedback



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

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

Answer / Sunil Kumar Bhagat

To generate a sequential receipt number automatically, you can use various programming languages. Here's an example in PHP:

```php
function generateReceiptNumber() {
static $number = 1;
return ++$number;
}
```

This function will return a unique sequential receipt number each time it is called.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

Describe the following: (i) DNS (ii) Name Resolution (iii) Subnet Masking (iv) Urgent Pointer

1 Answers  


Programs in JAVA to get the remainder and quotient of given two numbers without using % and / operators?

2 Answers  


Is the IT field raise again? What is the position of IT after 4 years?

1 Answers  


give idea for creating screen in abap

1 Answers  


5. How do you round the addition or subtraction of two numbers in assembler?

1 Answers   Wipro,


Diff between %let and Call symput?

1 Answers   Accenture,


Number of null pointers in any binary tree

5 Answers   Infosys,


I've an application where i need to give access to all the features only to admin and only few features to normal users. Say Menu...i dont want all my menu items to be accessible to all the users only the admin people can see few all the features where as normal users can have access to limited menu items...how can i achieve this. Please note that my menu is not a database driven menu.

1 Answers   Tesco,


Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fit" instead of the number and for the multiples of five print "Bit". For numbers which are multiples of both three and five print "FitBit".

1 Answers  


why should i hire u

16 Answers   Google, Satyam,


what is dot net framework

1 Answers   NIC,


My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?

1 Answers   State Bank Of India SBI,


Categories