|
System.Data.OleDB.OleDBConnection();// OleConn;
System.Data.OleDB.OleDBConnection OleConn;
"Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\tony.mdb";
OleConn.Open();
the following code is giving error
OleDB namespace not exist??
please tell how to tackle that error and how to acess the database
|
|
|
|
|
The code should be:
System.Data.OleDb.OleDbConnection OleConn = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\tony.mdb");
OleConn.Open();
|
|
|
|
|
I've found this, potentially, useful code example on the Interweb:
delegate object WorkDelegate(string arg);
public object DoWork(string arg)
{
WorkDelegate d = new WorkDelegate(DoWorkHandler);
IAsyncResult res = d.BeginInvoke(arg,null,null);
if(res.IsCompleted == false)
{
res.AsyncWaitHandle.WaitOne(10000,false);
if(res.IsCompleted == false)
throw new ApplicationException("Timeout");
}
return d.EndInvoke((AsyncResult)res);
}
private object DoWorkHandler(string arg)
{
Thread.Sleep(5000);
return "blah " + arg;
}
From here: http://www.developerfusion.co.uk/show/4497/[^]
The intent is to allow a synchronous method to timeout - I'd like to use this as I have to make a call to a barcode scanner api, which has no built in timeout and is prone to hanging/crashing/locking up my application when it fails.
Can any of the more experienced denizens of this handy forum spot any problems with it? Is there a huge "gotcha!" anywhere?
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
This may return control to the caller of DoWork after the timeout, but it does not stop the DoWorkHandler from executing. The BeginInvoke is going to execute on a thread from the ThreadPool. If you have lots of orphaned DoWorkHandlers running, then you could tie up all the threads available from the pool. There are some classes in the .Net framework that use the thread pool. So you may see other problems, if they are starved for ThreadPool threads. Your best bet is to timeout in DoWorkHandler.
Also, the timeout exception should use this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
HI,
can i insert controls into a ToolTip?
can i Change it appreance (color,Make it look like aballon, etc)?
THNAKS
kobkob
|
|
|
|
|
|
how to get the local system's ip address any method vailable..to get it programatically
|
|
|
|
|
Don't double post
Paul Marfleet
|
|
|
|
|
thatz sry any am increasing de chance of getting answered
|
|
|
|
|
Double-posting your questions is considered rude. People will notice and probably ignore both posts.
Consider carefully which forum is most appropriate for your question and post there. If someone wants to help you, they will do so. Double-posting only decreases your chances of getting help.
Paul Marfleet
|
|
|
|
|
Can I define a parameter such as "out string[][] myParameters" ?
|
|
|
|
|
jason_mf wrote: Can I define a parameter such as "out string[][] myParameters" ?
yes.
try it.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
Is there any way of setting a DataGridViewRowHeader to show a CheckBox inside?
Thanks
|
|
|
|
|
There is no build-in way to do that. What I have done when I wanted to do something like that was create the CheckBox on the fly, and set the position to inside the row header you want it to be in. Then in the resize event on the control have it move the check box to the same position on the row header.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi,
I have a form that has a data grid on it with name and address columns.
When a user adds their name and address details to the table and clicks on the details button I want their data to automatically be added to the details form using text boxes.
I'm unsure of the code for data value details?
frm.customer =
Can someone please help me?
Thanks in advance
|
|
|
|
|
Set up a delegate to pass the data between forms
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This, again has to do with graphics, because I 'lost' the other posts, but I still have the thoughts around. My plan was to make a VERY, basic simple game called 'Squares'. There are to squares. You move with the arrow keys (I completed this), and try to keep your square from touching the other. (I can do the collision). The only thing I need to now is how to move the square (player). I'm trying panel1.Invalidate(); right now...
Thanks again, for those who keep reading... AND in advance.
|
|
|
|
|
|
I'm not sure where you're stuck. You are changing the values for the square, but it's not redrawing ? If you have another square moving all the time, you should have a timer which, when it fires, changes the position of the other square(s) and calls Invalidate(). What's panel1 for ? You probably want no controls on your form at all, it will just comprise of the game. In this case, you call this.Invalidate(); this is superfluous, but it makes the scope clear.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Could you give an example? I tried this.Invalidate(); and nothing happened.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Invalidate will definately cause your form to repaint itself. Put a breakpoint on the invalidate call to see when it gets called, then when it's called, put one in your paint event and step through to see why your box is not being drawn as you expect.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What's a breakpoint do? Simple question probably, but I'm new...
The most knowledge doesn't mean the most wise...
|
|
|
|
|
I JUST GOT IT TO WORK!! THANKS A LOT!!!;P
The most knowledge doesn't mean the most wise...
|
|
|
|
|
NP - sorry I didn't come back sooner, very busy day for me today.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It's cool.
The most knowledge doesn't mean the most wise...
|
|
|
|