|
I am creating html file at run time using the StreamWriter object. After creating 2000 files throws an error Arthimetic operations results in overflow?
Can any one help me ?
Thanks in Advance
|
|
|
|
|
msharmamahesh wrote: After creating 2000 files throws an error Arthimetic operations results in overflow?
What's the code? What are the inputs to the "Arithmetic operations"? What are the expected results of the arithmentic operations?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
What I am doing is just fire a query from sql server, If the number of records are 30000 then there is no problem but after 32000 records is show an error.I am releasing memory after every 50 page like that
If gstrHTMLFileCounter Mod 50 = 0 Then
GC.Collect()
GC.GetTotalMemory(True)
GC.WaitForPendingFinalizers()
End If
I am not using integer all the fetch records are string ?
Thanks
mahesh
-- modified at 6:14 Tuesday 25th April, 2006
|
|
|
|
|
msharmamahesh wrote: If the number of records are 30000 then there is no problem but after 32000 records is show an error
I would guess that it is actually after 32767
You have an Int16 somewhere in your .NET code or a SMALLINT in your database. However, since you show neither I cannot see what it might be.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
But I am not using Int16 in dot net code and SMALLINT in database, still getting error.
|
|
|
|
|
Well, something has a signed 16bit limit on it and that is the most likely cause of your overflow error.
You need to post appropriate code - that includes the declaration of variables so the types are known.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Thanks Dear your are very right My problem is solved.
Thanks a lot
Mahesh
|
|
|
|
|
Hi colin, I am calling our own API for creating a PDF files at run time. Also I am releasing memory after every 10 pages created at run time like that
If gstrPDFFileCounter Mod 10 = 0 Then
GC.Collect()
GC.GetTotalMemory(True)
GC.WaitForPendingFinalizers()
End If
But after 1046 files created successfully It stops creating pdf files and does not show any error. I think there is some memory leak. How do i fix it.
Thanks
Mahesh
-- modified at 0:56 Wednesday 26th April, 2006
|
|
|
|
|
Do you have an int somewhere that you are indexing and maybe not setting back to zero between writes?
|
|
|
|
|
Hi paddy,
Dear my Arthimetic opeartions overflow problem is solved.
Now my problem is
I am calling our own API for creating a PDF files at run time. Also I am releasing memory after every 10 pages created at run time like that
If gstrPDFFileCounter Mod 10 = 0 Then
GC.Collect()
GC.GetTotalMemory(True)
GC.WaitForPendingFinalizers()
End If
But after 1046 files created successfully It stops creating pdf files and does not show any error. I think there is some memory leak. How do i fix it.
|
|
|
|
|
hi all
can anybody tell me the advantage of using multiple config files.
coolsweety
|
|
|
|
|
You can define custom settings for different folders? What exactly would you like to know?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
How to change the colour of my datagrid scroll bars in win forms and c#
Thanx,
meer
Software Developer
Pune.
|
|
|
|
|
This is the ASP.NET forum. You would be better of asking the question in the C# forum instead, as it's not web related.
---
b { font-weight: normal; }
|
|
|
|
|
i wanna know how to change the combobox scrollbar color in windows based application.
can anyone helop me out n tell me by which property setting i ll get different color of scrollbars..
eagerly waiting for reply
Thanx,
meer
Software Developer
Pune.
|
|
|
|
|
this is the asp.Net forum, maybe you can ask your question in the C# or the VB.Net forum?
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
I am developing an application in which I have to ask the user to upload some file (of .jpg,.gif or .bmp formats). I want to store that file in a directory in my root directory of the application. I need to create a special folder for each user in that folder and paste those files uploaded from the user. Plz send me some sample code if u have any or just send me some suggestion of the classes and functions to be used.
Thanks,
Sandy
|
|
|
|
|
|
But FileUpload class is present only in .NET 2.0 whereas I am using 1.1 version for my whole project. Plz tell me the method to do it in .NET 1.1 framework
Thanks,
Sandy
|
|
|
|
|
Try the below code,It is working in .Net 1.1
//uploading files control
System.Web.UI.HtmlControls.HtmlInputFile ctlImageInput;
//Declarations
string strFileName;
string strFilePath;
string strFolder;
//u can use the unique user name for all the folders
strFolder = AppDomain.CurrentDomain.BaseDirectory + "Images/username";
// Creating Directory
if ((!(Directory.Exists(strFolder))))
{
Directory.CreateDirectory(strFolder);
}
//Saving source file to destination
if( ctlImageInput.Value !="")
{
strFileName = ctlImageInput.PostedFile.FileName;
strFileName = Path.GetFileName(strFileName);
strFilePath = strFolder + "/"+ strFileName;
ctlImageInput.PostedFile.SaveAs(strFilePath);
}
|
|
|
|
|
But I don't have .NET 2.0 and I want to bring the file from client's computer to my server.
Whenever I use the above code , it says object reference not set to an instance of an object. In Html code I had taken,
Thanks,
Sandy
|
|
|
|
|
public class Uploadphoto : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Label Label1;
string strPath;
private void Page_Load(object sender, System.EventArgs e)
{
long ID = 8;
// long PropertyID = long.Parse(Request.QueryString["id"]);
string appPath = Server.MapPath("Photos");
strPath = appPath + "\\" + ID.ToString();
System.IO.Directory.CreateDirectory(strPath);
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
string strFile = Request.Form["inpFile"].ToString();
string strFileName = strFile.Substring(strFile.LastIndexOf("\\")+1,strFile.Length-(strFile.LastIndexOf("\\")+1));
File.Copy(Request.Form["inpFile"],strPath + "\\" + strFileName);
}
}
and my HTML code is
<HTML>
<HEAD>
<title>Uploadphoto</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 110px; POSITION: absolute; TOP: 57px" runat="server"
ForeColor="Red" Visible="False">You can only add files with .jpg,.gif or .bmp extensions</asp:Label>
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 378px; POSITION: absolute; TOP: 127px" runat="server"
Text="Upload"></asp:Button><INPUT style="Z-INDEX: 104; LEFT: 107px; POSITION: absolute; TOP: 128px" type="file" id="inpFile"
name="inpFile">
</form>
</body>
</HTML>
The problem is that when I click the Upload button after browsing and selecting a file in FileInput control, I get the following exception
Exception Details: System.IO.FileNotFoundException: Could not find file "C:\Documents and Settings\Sandy\Desktop\cities.txt".
Source Error:
Line 66: string strFile = Request.Form["inpFile"].ToString();
Line 67: string strFileName = strFile.Substring(strFile.LastIndexOf("\\")+1,strFile.Length-(strFile.LastIndexOf("\\")+1));
Line 68: File.Copy(Request.Form["inpFile"],strPath + "\\" + strFileName);
plz help me. I want to upload the file from client machine to my server
Thanks,
Sandy
|
|
|
|
|
The earlier code will work to complete ur requirement
Declare a control as server control by below code
Now try..
-- modified at 8:35 Tuesday 25th April, 2006
|
|
|
|
|
Failed to open a rowset.
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: CrystalDecisions.CrystalReports.Engine.InternalException: Failed to open a rowset.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InternalException: Failed to open a rowset.]
[1].[1]K(String
, EngineExceptionErrorID
) +642
[1].[1]F(Int16 [1], Int32
--------------------------------------------------------------------------------
) +491
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext) +187
CrystalDecisions.ReportSource.LocalReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +174
CrystalDecisions.Web.ReportAgent.get_LastPageNumber() +34
CrystalDecisions.Web.ReportAgent.v(Boolean
--------------------------------------------------------------------------------
`) +90
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1499
Sathisha B N
|
|
|
|
|
Hi Sathisha,
Did u assign the dataset to the data source property of the crystal report.Check if there are any rows in the table.If the table is empty or if the query results are empty there are chances of getting this error.
Uma
|
|
|
|