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

Pradeep ShetRank #595 · 4K reputationPosted Aug 8, 2014, 9:19 AM EDT
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
sharan Kumar9 reputationPosted Aug 8, 2014, 9:32 AM EDT