|
Not a problem
|
|
|
|
|
Is there an inherent limitation to the amount of available memory for a 32bit .NET application? For a simple test I'm running out of memory at around 1.4 to 1.6gb.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
namespace MemoryTest
{
class Program
{
static void Main(string[] args)
{
int count = 0;
int size = 1024 * 1024 * 100;
byte[][] buffer = new byte[1024][];
try
{
do
{
buffer[count] = new byte[size];
Array.Clear(buffer[count], 0, buffer[count].Length);
Console.Out.WriteLine("count={0} size={1}", count.ToString(), buffer[count].Length.ToString());
MessageBox.Show("Click Ok to continue", "Got RAM?", MessageBoxButtons.OK, MessageBoxIcon.Question);
count++;
} while (true);
}
catch (Exception e)
{
Console.WriteLine("{0} Exception caught (count={1})", e, count.ToString());
}
}
}
}
Todd Smith
|
|
|
|
|
There is an inherit amount of memory available on your specific computer, that's for sure. I've run apps over the 1.4 gig mark, but I fixed them
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
haha, thats pretty much what i was thinking when reading the first post.
--
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
|
|
|
|
|
Todd Smith wrote: Is there an inherent limitation to the amount of available memory for a 32bit .NET application? For a simple test I'm running out of memory at around 1.4 to 1.6gb.
That has little to do with .NET vs native. See my blog entry on the topic[^]
|
|
|
|
|
I was under the assumption that the available heap was closer to 2gb per applicaiton without the /3gb hack. What is Windows doing with that extra 400-500mb?
Todd Smith
|
|
|
|
|
Am retrieving data from my databese engine to read the data, but encountering an error at dr.Read(), con.close().
public string constring = @" ";
SqlConnection con = new SqlConnection(constring);
SqlCommand cmd = new SqlCommand("select * from emp",con);
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
con.Close();
"Invalid token '(' in class, struct, or interface member declaration", what could be the reason for this?
-- modified at 18:59 Friday 9th February, 2007
|
|
|
|
|
This should be posted in the SQL Database section.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
sreecahitu wrote: new SqlConnection(" ");
How is that a connection string ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I indicated the connection string correctly with source,user name and pwd, but i didnt mention here.
string constring=@"source, user="",password="" ";
SQLConnection con=new SqlConnection("cosnstring");
|
|
|
|
|
OK, I think we've found the problem.
sreecahitu wrote: string constring=@"source, user="",password="" ";
When you use @, you need two " to make *one* quote. So, it's user=""name""
sreecahitu wrote: SQLConnection con=new SqlConnection("cosnstring");
Because you put it in quotes, you're passing in the value cosnstring, instead of the value of the variable with that name.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If i write as follows,
string constring=@"source, user=,password= ";
SQLConnection con=new SqlConnection(cosnstring);
still am getting an error.
|
|
|
|
|
This may seem like a stupid question, but which database engine are you using? SQL Server, MySQL, Access, Oracle, ... ?
You can find the correct format for your connection string at http://www.connectionstrings.com[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
That doesn't look like a valid connection string to me.
Did you post the actual code in the first instance ? Or did you change it in other ways ? This does not account for your actual error, really, which makes no sense to me, right now.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ya, thank you all,
i modified wrongly.
I got the problem, the problem is with declaring the declaration of string.
|
|
|
|
|
Just remove the @ character
Dabsukol
|
|
|
|
|
I have problem I use Northwind database to build some prototype application in C#.
Thing is when I set on Orders to display me EployeeID and CustomerID as listbox, I can select data source so they show only Name instead of ID, but Value is indeed ID of those 2.
However when I do this Datanavigator have no effect on those 2?
Wonder why since doing same thign on column in data grid work just fine.
Any idea?
Not exactly ado question I guess so I hope it's right room...
|
|
|
|
|
hello guys
i want to use my gprs modem /wirelsess card attatched on my pcmci throug my c# application,
means i want send and receive sms based on my business logic through this application ,,
any idea where to start ,, have any one done that before ,,
any help will be highly appreciated ,,
thanks in advance
hello
|
|
|
|
|
AFAIK you can talk to it like a normal modem.
Did you try Google, it turned up this[^] as my first result for my first search.
|
|
|
|
|
Hi!
I want to draw some semi-transparent rectangles over special regions of a richtextbox.
So I hook up in the DefWndProc of an inherited RichTextBox class.
This looks like this:
protected override void DefWndProc(ref Message m)
{
base.DefWndProc (ref m);
switch (m.Msg)
{
case WM_PAINT:
MyPaint();
break;
}
}
In MyPaint() I draw onto the richtextbox with a rectangle. This all works fine.
But when I start clicking into the richtextbox my rectangles becomes more and more "solid" (cumulating alpha channels I suppose)... What can I do to fix that? If I minimize the form and maximize it again, everything's fine again.
It really seems to me, that the richtextbox fires WM_PAINT messages too often without clearing the screen...
Clearing the richtextbox with Graphics.clear() or UserPaint is not a real option for me... I do not want to paint everything by myself. I also tried to capture the bitmap of this part of the screen and draw that (by clearing the screen after capturing the image). But I end up with the same problem.
I also tried to use the captured image to check if pixels are white or have some other color. Due to some (unknown) reason, that did not work out (though I could save that bitmap and it seems to show the right portion of the screen (and I was looking at the right pixels)
But I hope that there's an easier solution.
Cheers and thx for all help!
|
|
|
|
|
Hi,
While searching for the same functionality, I found your message. Please respond, if you find solution to draw semi-transparent rectangles in RichTextbox. Thanks in advance.
|
|
|
|
|
Hi there!
This is quite old If I remember correctly, I did use the back color drawing of the richttextbox for a while. But when I realized that things became too slow and all my colored boxes in the rtf where flickering (I needed to repaint boxes where the user dragged the mouse over) I finally made up a richtextbox myself. In the end this was the best decision for me and even did not took too much time (maybe because I did soo many different things with the rtf that writing your own was easy then). With my own kind of rtf I finally could draw everything the way I wanted (using GDI+) and it now works fine and fast (much faster than the rtf) with no flickering at all (even if I heavily use boxes and alike).
I am sorry but I cannot post any code here, as this rtf was part of a business work and I sold it, thus this wouldn't be okay to do so. And the code for this is also quite specific and it is much code.
But if you want to do something special with rtfs think about doing it all yourself. As I said, it took me less time doing it myself, than trying to get the rtf to do what I wanted. (Of course this depends on what you want to do with the rtf).
Hope this will help you a bit.
Cheers
|
|
|
|
|
i know this is a c# forum but couldn't find one vb. if i get a sample how to it in C# no prob i can convert it
Default using vb.net to post to a website
i want to post a string to a website can anyone show me or point me to example of how you would use vb.net to post a string to a website and accept the response sent back from post / request to the site?
|
|
|
|
|
keroed_edmond wrote: i know this is a c# forum but couldn't find one vb.
The Code Project discussion boards - Visual Basic / VB.NET[^]
Regarding your actual question, the HttpWebRequest class may what you're looking for.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|