15,907,497 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by rajrprk (Top 32 by date)
rajrprk
14-Dec-12 7:39am
View
Pasted code can you look at it please
rajrprk
5-Sep-12 8:32am
View
Can you able to respond with simple solution
rajrprk
17-Mar-12 2:52am
View
Here i m going to import an XML file, When i import XML file in my local machine i getting the following errors like..
Could not find file "C:\WINDOWS\system32\KPMCLT0001_plf_memberwise_Jan12.xml".
KPMCLT0001_plf_memberwise_Jan12.xml This is XML file name what i tried to import.
Exception Details: System.IO.FileNotFoundException: Could not find file "C:\WINDOWS\system32\KPMCLT0001_plf_memberwise_Jan12.xml".
Once i place this KPMCLT0001_plf_memberwise_Jan12.xml file in this location C:\WINDOWS\system32\ i didn't get error. But i dont want to place that file in C:\WINDOWS\system32\
rajrprk
3-Mar-12 5:19am
View
If (strr = Nothing) Then
'Something
End if
i have changed like this now it's ok
rajrprk
3-Mar-12 5:01am
View
here i m getting error like this
ie., 'IsNullOrEmpty' is not a member of string
rajrprk
27-Feb-12 6:03am
View
Hello this is another post but relevant to that post
rajrprk
24-Feb-12 0:55am
View
Deleted
Hello this is another post but relevant to that post
rajrprk
22-Feb-12 7:14am
View
Thanks a lot
rajrprk
22-Feb-12 6:13am
View
arrayOfStrings(1) for this i am getting YYYYMM. But i want the value ie.,200502. Here YYYYMM, ename,gae,sex all are field name i want the value of the field.
rajrprk
9-Feb-12 4:06am
View
Here i m not passing value to row identity column. if one user insertings means no problem when N number of user inserting means that time alone problem with this trigger
rajrprk
2-Jan-12 6:58am
View
i have created three string builder ie., SB,SB1,SB2
string BK_Code = ((ImageButton)sender).CommandName;
StringBuilder sb = new StringBuilder();
sb.Append("<Script language='javascript'>");
sb.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb.Append("if (m_Format == 'TTL')");
sb.Append("window.open('Rpt_BL_BKN_GBI.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb.ToString());
StringBuilder sb1 = new StringBuilder();
sb1.Append("<Script language='javascript'>");
sb1.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb1.Append("if (m_Format == 'GBI')");
sb1.Append("window.open('Rpt_BL_BKN_GBI.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb1.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb1.ToString());
StringBuilder sb2 = new StringBuilder();
sb2.Append("<Script language='javascript'>");
sb2.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb2.Append("if (m_Format == 'AIC')");
sb2.Append("window.open('Rpt_BL_BKN_AIC.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb2.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb2.ToString());
But still not redirecting
rajrprk
2-Jan-12 6:48am
View
Deleted
i have created three string builder ie., SB,SB1,SB2
string BK_Code = ((ImageButton)sender).CommandName;
StringBuilder sb = new StringBuilder();
StringBuilder sb1 = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
sb.Append("<Script language='javascript'>");
sb.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb.Append("if (m_Format == 'TTL')");
sb.Append("window.open('Rpt_BL_BKN_TTL.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb.ToString());
sb1.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb1.Append("if (m_Format == 'GBI')");
sb1.Append("window.open('Rpt_BL_BKN_GBI.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb1.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb1.ToString());
sb2.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
sb2.Append("if (m_Format == 'AIC')");
sb2.Append("window.open('Rpt_BL_BKN_AIC.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb2.Append("</Script>");
ClientScript.RegisterStartupScript(typeof(string), "Print", sb2.ToString());
But still not redirecting
rajrprk
29-Dec-11 4:24am
View
i have tried that one also for this only i m getting this error
Input string was not in a correct format
rajrprk
29-Dec-11 4:17am
View
" + Convert.ToInt32(dr("SAVINGS")) + "
ya sorry i have tried that one also for this only i m getting this error
Input string was not in a correct format
rajrprk
29-Dec-11 4:10am
View
if i use like this " + dr("SAVINGS") + "'i m getting error follows
Input string was not in a correct format
rajrprk
29-Dec-11 2:22am
View
While inserting at that time i want to convert that to numeric value
rajrprk
29-Dec-11 2:21am
View
i have updated now
rajrprk
29-Dec-11 2:21am
View
ya i have tried that one too (like this '" + dr("SAVINGS") + "'
rajrprk
7-Dec-11 7:00am
View
not a same column name, XML file i m retriving using the tag name
rajrprk
7-Dec-11 6:49am
View
Please post some sample code with this example i m new to this concept
rajrprk
2-Dec-11 4:50am
View
i added the code but i didn't get data
whether i want to add the field in itemtemplate
rajrprk
30-Nov-11 5:53am
View
reportData.ReadXml(Server.MapPath("report.xml"));
instead of the above code i want to select and upload the xml.file. but here it is statically declared as report.xml
My need is, i m having an fileupload control when i select a file then i want to insert the corresponding XML file into the table
rajrprk
29-Nov-11 6:21am
View
here i m getting error 'object' does not contain a definition for 'Parent'
rajrprk
9-Nov-11 4:55am
View
Better U can set as a varchar (or) nvarchar field
rajrprk
9-Nov-11 4:28am
View
ok ...........
rajrprk
9-Nov-11 4:18am
View
i want to show empty rows programmatically, If grid contain 15 records means pagesize=10 then it will take 2 pages. in the 2nd page contain only 5 records in that 2 page i want add 5 extra rows. This is my requirment. Not foe every page of the gridview
rajrprk
9-Nov-11 2:31am
View
Deleted
IF possible to help then do or otherwise live it ok....
rajrprk
9-Nov-11 2:27am
View
ok here i had applied but i m not getting any empty row the grid
rajrprk
9-Nov-11 2:21am
View
Deleted
hello here din't got any error, but my requirment is to show empty row in the grid view. Here i m not getting any empty row in the grid view
rajrprk
9-Nov-11 1:46am
View
private void BindGrid()
{
//int iPageSize = 0;
//int iRow = 0;
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=Demo_eLogsVA4;Integrated Security=True");
cn.Open();
string q = "Select Convert(nVarchar,A.Rec_No) CRec,A.Acc_Name Descr,A.Quantity Qty,Convert(nVarchar,A.Sell_Rate) SRate,Sell_CName Sname , Sell_CCode SCCode, Sell_CValue SCValue ,Convert(numeric,A.Quantity*A.Sell_Rate*Sell_CValue) as SAmount, A.Service_Tax STax,Convert(nVarchar,(A.Quantity*A.Sell_Rate*Sell_CValue)* A.Service_Tax/100)Tax_Amount,Convert(numeric,((A.Quantity*A.Sell_Rate*Sell_CValue)+(A.Quantity*A.Sell_Rate*Sell_CValue)* A.Service_Tax/100)) as Net From eLogs_Invoice_Charges_Details A Where A.Invoice_Code='INV1'";
//string qq = "Select COUNT(*) From eLogs_Invoice_Charges_Details A Where A.Invoice_Code='INV1'";
DataSet dset = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(q, cn);
//DataTable dtable = new DataTable();
da.Fill(dtable);
if (dtable.Rows.Count < 5)
{
GridView1.DataSource = dtable;
GridView1.DataBind();
}
else
{
ShowNoResultFound(dt, GridView1);
}
object obj = dtable.Compute("Sum(Net)", "");
object amt=dtable.Compute("Sum(SAmount)","");
decimal value=0;
if (obj != null)
{
value = (Decimal)obj;
}
else
{
// obj is null.
}
//DataRow dr;
//for (int i = dt.Rows.Count; i < 10; i++)
//{
// dr = dt.NewRow();
// dr[0] = dr[1] = dr[2] = dr[3] = dr[4] = "";
// dt.Rows.Add(dr);
//}
//dt.AcceptChanges();
//object obj = dtable.Compute("SUM(Net)", string.Empty);
//dtable.Rows.Add(new object[] { "", "" });
//dtable.Rows.Add(new object[] { "", "" });
//iPageSize = Convert.ToInt32(GridView1.PageCount.ToString());
//iRow = Convert.ToInt32(GridView1.Rows.Count.ToString());
GridView1.FooterRow.Cells[1].Text = "Total:";
GridView1.FooterRow.Cells[7].Text = amt.ToString();
GridView1.FooterRow.Cells[10].Text = value.ToString();
//GridView1.FooterRow.Cells[2].Text = iRow.ToString();
//GridView1.FooterRow.Cells[3].Text = iPageSize.ToString();
GridView1.FooterStyle.Font.Bold = true;
cn.Close();
}
private void ShowNoResultFound(DataTable source, GridView gv)
{
source.Rows.Add(source.NewRow()); // create a new blank row to the DataTable
// Bind the DataTable which contain a blank row to the GridView
gv.DataSource = source;
gv.DataBind();
// Get the total number of columns in the GridView to know what the Column Span should be
int columnsCount = gv.Columns.Count;
gv.Rows[0].Cells.Clear();// clear all the cells in the row
gv.Rows[0].Cells.Add(new TableCell()); //add a new blank cell
gv.Rows[0].Cells[0].ColumnSpan = columnsCount; //set the column span to the new added cell
//You can set the styles here
gv.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center;
gv.Rows[0].Cells[0].ForeColor = System.Drawing.Color.Red;
gv.Rows[0].Cells[0].Font.Bold = true;
//set No Results found to the new added cell
gv.Rows[0].Cells[0].Text = "NO RESULT FOUND!";
}
Here i m getting error ie., Object reference not set to an instance of an object.
rajrprk
9-Nov-11 1:29am
View
private void BindGrid()
{
//int iPageSize = 0;
//int iRow = 0;
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=Demo_eLogsVA4;Integrated Security=True");
cn.Open();
string q = "Select Convert(nVarchar,A.Rec_No) CRec,A.Acc_Name Descr,A.Quantity Qty,Convert(nVarchar,A.Sell_Rate) SRate,Sell_CName Sname , Sell_CCode SCCode, Sell_CValue SCValue ,Convert(numeric,A.Quantity*A.Sell_Rate*Sell_CValue) as SAmount, A.Service_Tax STax,Convert(nVarchar,(A.Quantity*A.Sell_Rate*Sell_CValue)* A.Service_Tax/100)Tax_Amount,Convert(numeric,((A.Quantity*A.Sell_Rate*Sell_CValue)+(A.Quantity*A.Sell_Rate*Sell_CValue)* A.Service_Tax/100)) as Net From eLogs_Invoice_Charges_Details A Where A.Invoice_Code='INV1'";
//string qq = "Select COUNT(*) From eLogs_Invoice_Charges_Details A Where A.Invoice_Code='INV1'";
DataSet dset = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(q, cn);
//DataTable dtable = new DataTable();
da.Fill(dtable);
GridView1.DataSource = dtable;
object obj = dtable.Compute("Sum(Net)", "");
object amt=dtable.Compute("Sum(SAmount)","");
decimal value=0;
if (obj != null)
{
value = (Decimal)obj;
}
else
{
// obj is null.
}
DataRow dr;
for (int i = dt.Rows.Count; i < 10; i++)
{
dr = dt.NewRow();
dr[0] = dr[1] = dr[2] = dr[3] = dr[4] = "";
dt.Rows.Add(dr);
}
dt.AcceptChanges();
//object obj = dtable.Compute("SUM(Net)", string.Empty);
//dtable.Rows.Add(new object[] { "", "" });
//dtable.Rows.Add(new object[] { "", "" });
GridView1.DataBind();
//iPageSize = Convert.ToInt32(GridView1.PageCount.ToString());
//iRow = Convert.ToInt32(GridView1.Rows.Count.ToString());
GridView1.FooterRow.Cells[1].Text = "Total:";
GridView1.FooterRow.Cells[7].Text = amt.ToString();
GridView1.FooterRow.Cells[10].Text = value.ToString();
//GridView1.FooterRow.Cells[2].Text = iRow.ToString();
//GridView1.FooterRow.Cells[3].Text = iPageSize.ToString();
GridView1.FooterStyle.Font.Bold = true;
cn.Close();
}<pre lang="c#"><pre lang="c#"></pre></pre>
i have error in the above code.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 50: }
Line 51: DataRow dr;
Line 52:
for (int i = dt.Rows.Count; i < 10; i++)
Line 53: {
Line 54: dr = dt.NewRow();
The purpose of this for loop is to insert blank row if pagesize not equal to the pagerows in the grid view
rajrprk
9-Nov-11 1:18am
View
Before the DataRow dr; what should i fill there. I have already filled the grid in the bind method itsely. Please let me know
Show More