|
System.Net.WebClient client = new System.Net.WebClient();
client.DownloadFile("http://www.mydomain.com/myfile.mdb", @"C:\Program Files\My App\myfile.mdb");
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Ok I know how to get a file from the net... I mean how the fetch the data inside of it? I mean getting some rows or applying an SQL query or whatever???
|
|
|
|
|
Ah, okay. Totally misunderstood your question.
Anyway, what you would do is use the System.Data namespace and the System.Data.OleDb namespace, then use the OleDbCommand object to set your select query (a SQL Statement) and the OleDbConnection object to connect to your data, and the OleDbDataAdapter to grab the data and put it in a DataSet object.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Ok i also know the System.Data.OleDb namespace but i don't think this class supports external(files on the net) files??? Amn't i right?
|
|
|
|
|
No, you just need to setup a connection string to connect to the DB, or you can use a DSN.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
I have a memorystream full of data.
I try and use the MemoryStream.Write(byte[],0,MemoryStream.Length) and it fills my byte array up with all zero's almost like it never copied. I can verify there is data in the MemoryStream. The position of the memory stream is at 0 so that's not it.... Can anyone help me? I just don't get it.
Thanks very much,
Steve Nelson
|
|
|
|
|
Whats the position of the memory stream? Did you set it back to 0?
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Write(byte[] buffer, int offset, int count)
Writes a block of bytes to the current stream using data read from buffer.
Read(byte[] buffer, int offset, int count)
Reads a block of bytes from the current stream and writes the data to buffer.
Your code is copying the contents of the buffer - which will be zero - to the stream. It sounds like you want to copy the contents of the stream to the buffer, in which case you need to use the Read method.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
hehe, didn't even notice that
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Hi there,
Does anybody know is there an alternative System.Windows.Forms.Form class that is different. I mean like System.Windows.Forms.LinuxForms for example... or some another class that a firm does or ...???...
Thanx in advance...
|
|
|
|
|
Well, I don't know any, but why exactly do you need one?
|
|
|
|
|
Just for fun, just to be different...
|
|
|
|
|
http://www.go-mono.org/[^]
Look for Gtk# on their site. If you want to see how it looks like, take a look at the screenshots.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
|
HI
I am a begginer in cascaded style sheets. where i can get the good resources for cascaded style sheets to start using with c# or asp.net.
Love U ALL
|
|
|
|
|
slah wrote:
I am a begginer in cascaded style sheets. where i can get the good resources for cascaded style sheets to start using with c# or asp.net.
CSS is client side and has nothing to do with C# or ASP.NET. I suggest you ask in the web development forum.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
How do I get a control I made to work?
I created a new project.
In it I created a custom control(Didn't add anything except some drawing code). Used it in other program then. Result: Nothing shows up when I try to add it on a form???
Then I tried to create a user control. Used it in another program. Result: When I try to add, I get "The user control 'name' could not be loaded. Ensure that the library containing the control has been built and a project reference has been made to the library containing the control. If you have changed the name bla bla bla"
What am I doing wrong? It is referenced and built...
|
|
|
|
|
Hmm... did some more trying and it seems that the custom control seems to work fine if I create it manually with new. Hmm???
|
|
|
|
|
Are you calling the default constructor or one that you have defined? The forms designer will call the default constructor in most cases.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Default. Didn't make another constructor
|
|
|
|
|
Locked Ghost wrote:
Default. Didn't make another constructor
Therein lies the problem, I think. You need a Designer constructor much like this:
public MyControl(System.ComponentModel.IContainer container)
{
container.Add(this);
} Without that, the designer cannot add the control to the container (Form/Panel/etc).
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|
|
|
Locked Ghost wrote:
Thanks
Don't thank me yet, I made a mistake there. See Roger J's mail below.
Sorry about that.
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|
|
that was wrong , you describe a constructor for a COMPONENT not a CONTROL
controls are added to the parent container via the form initialize code..
like
this.controls.addrange ({....,....,...,...});
//Roger
|
|
|
|
|
Roger J wrote:
that was wrong , you describe a constructor for a COMPONENT not a CONTROL
Damn! Well spotted. I opened the wrong file
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|