TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rimmi anand
NA
6
4.6k
Getting IErrorInfo.GetDescription failed with E_FAIL(0x80004005). public string generateInvoi...
Jun 20 2012 1:36 PM
I want to retrieve last digits from the invoice number. I want to get value why I am getting this error. which is the keyword. I have tried [] also but it's giiving error.
public string generateInvoiceNo(string PRODUCTNAME) {
try {
con.Open();
string number;
OleDbDataAdapter DA1 = new OleDbDataAdapter
("SELECT Max(INVOICE_NO.SUBSTRING(9,5)+1) AS MAXINVOICE FROM PRODUCT_DETAILS", con);
DataTable DT1 = new DataTable();
DA1.Fill(DT1);
if (DT1.Rows.Count > 0)
{ number = DT1.Rows[0]["MAXINVOICE"].ToString();
}
else
{ number = "00001"; }
OleDbCommand cmd2 = new OleDbCommand
("SELECT [D_NO].SUBSTRING(0,2) AS [D_NO] FROM [PRODUCT_MASTER] WHERE [PRODUCT_NAME]='" + PRODUCTNAME + "'", con);
OleDbDataAdapter DA2 = new OleDbDataAdapter(cmd2);
DataTable DT2 = new DataTable();
DA2.Fill(DT2);
string dno = DT2.Rows[0]["D_NO"].ToString() + System.DateTime.Today.ToString(); return dno; }
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
finally
{
con.Close();
}
}
Reply
Answers (
1
)
move cards like game Solitaire
System error(missing operator) in query expression '19-06-2012'