|
I am using the following database connection in my device application
SqlceConnection con=new SqlceConnection ("Data Source=D:\\bd1\\db.sdf");
i kept db.sdf in same location.
but it is giving error message file not found. Help me out...
|
|
|
|
|
I have a VC++ dll and i want to call it in my C# Windows Application.
How can I do it?
|
|
|
|
|
|
Either DllImport or if it is COM registered then Interop.
|
|
|
|
|
hi,
i have a webpage with to textbox named username and password and a datagrid. i have also a add button. whenever i click the add button then the contenct of both textboxes must be fill in the datagrid but i dont want to save the record in the database until i click another button "Submit". I also have to delete the record from the datagrid. then what should i do.
Pankaj
|
|
|
|
|
Using datasets solve the pblm
|
|
|
|
|
|
Good Day Sir/Maam,
I have now finished by project and have created a *.hlp file using WinHelp.
I have a Menu Bar and it contains a HELP menu.
Is it possible that when the user clicked on the HELP menu, the *.hlp file will run?
Thank you in advance.
|
|
|
|
|
Hi.
Yes it's possible. If you have your help file in the same catalog as program, you can use this code:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "Help.hlp";
p.Start();
|
|
|
|
|
Very nice. Did the job.
Thank you sir.
|
|
|
|
|
|
I am using .NET 2005 c# with NHibernate 1.0.2, with the method CreateCriteria, it return value is IList, but in .NET 2005 only has IList<>. how to convert IList to IList<> or how to slove it problem
|
|
|
|
|
Hi.
You can use IList interface in .NET 2.0, it's situated in System.Collections namespace. But answer to your question you'll find on this page:
http://dimapasko.spaces.live.com/blog/cns!19D0AD1FA1CDA8!138.entry
and
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=966134&SiteID=1
|
|
|
|
|
|
Hi All,
Greetings. When I am tring to send mails from my domain using System.Web.Mail.
System.Web.HttpException: The transport failed to connect to the server. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
This is the error I am getting. Please help me on this issue. Thanks in advance...
JIJO BABY - Lets Play C#
|
|
|
|
|
|
|
|
My program uses multiple threads to do something, and i want to make a progress bar to show the process status, the problem is that i can't update the progressbar from the thread (gives an exception..not the thread it was created on).
what can i do?
|
|
|
|
|
Use the standard technique (InvokeRequired/Invoke) explained over and over in CP articles;
both of my articles contain a simple example.
|
|
|
|
|
Uhh...well...I read a bit and it seems to be really confusing...a small simplified example would be nice :\
|
|
|
|
|
Hi, the last code snippet in my Sokoban article shows the simplest example possible:
executing a method with one argument on the UI thread (it is an excerpt from file
MainForm.cs)
|
|
|
|
|
Uhh...i don't get it (especially cause I'm not very familiar with delegates...so can you explain what this does:
Invoke(new MovePaster(pasteOneMove), new object[]{c});
You send a function into a delegate? but the function is void and has a char as a parameter (And so does the delegate)...so...uhh...I'm confused :\
|
|
|
|
|
Hi, whenever you create a Win app in .NET you use delegates; how else would you connect
an event handler (e.g. myButton_Click) to the corresponding event ?
When you write
myButton.Click+=new EVentHandler(myButton_Click);
you pass a method to the handler's constructor; this does not call myButton_Click,
it tells the button that when clicked it will have to run myButton_Click for this object.
This is fundamental to .NET, whether using C# or not.
Invoke is similar, the line
Invoke(new MovePaster(pasteOneMove), new object[]{c});
will cause the execution of the specified method (with specified argument list), so it
logically corresponds to a simple pasteOneMove(c);
but it does not execute the method on the calling thread, it sends a message to the
message pump and that message causes pasteOneMove(c); to be executed on the UI thread.
A delegate is used gfor this; it is an object used to combine the relevant object and
method in a structured (type-safe) way.
I recommend you read more about this in any .NET programmers book, then have a look at
some of the many examples around.
|
|
|
|
|
So if i want to update my progress bar...i need to do something like this?
private delegate void SetPrecentage(int p);
<br />
private int DoOperation(int p)<br />
{<br />
if (this.InvokeRequired){<br />
Invoke(new SetPrecentage(DoOperation),new object[]{p});}<br />
}<br />
but then...how do i like, update the progress bar?
|
|
|
|