sir i want to generate alphanumeric number to my label in c# windows form
this is my code
public class DBcodes
{
public string Sales_Invoice {get; set;}
public string Customer_Name {get; set;}
public string Mobile_No {get; set;}
public string Address {get; set;}
public string Item_Name {get; set;}
public string Item_Code {get; set;}
public string Dept {get; set;}
public string Date {get; set;}
public int Qty {get; set;}
public int Rate {get; set;}
public int Vat_tax {get; set;}
public int Amount {get; set;}
public int Payment_Type {get; set;}
public int Purchase_ID { get; set; }
string myConnection =
public void retriveData()
{
string selQuery="select sales_invoice from sales";
try
{
SqlConnection conn= new SqlConnection (myConnection);
conn.Open();
SqlCommand cmd = new SqlCommand (selQuery, conn);
Sales_Invoice=(string)cmd.ExecuteScalar();
conn.Close();
}
catch
{
Sales_Invoice=name/sales/1000;
please help me
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sharan KumarPosted Aug 8, 2014, 1:32 PM
Pradeep ShetPosted Aug 8, 2014, 1:19 PM
Can you elaborate it because I am unable to link it...
Still whatever I am able to understand it,
you can use SELECT MAX(PrimaryColumn) FROM sales
This will return you the last entry made with the help of ExecuteScalar()
Then you can add your prefix or postfix charater with the max integer value. Hope this helps you