|
I don't know which bit you are needing help with. Listing the SQL Server instances or taking the backup.
You can use SMO (SQL Server Mangement Objects) to enumerate the available servers. http://msdn.microsoft.com/en-us/library/ms162169.aspx[^]
Since a SQL Backup can only be done to the machine that a SQL Server resides on a LAN isn't necessary. In fact, it won't make any difference since the backup file must be local to the SQL Server.
You can issue a backup command through the SqlCommand object in the .NET Framework and ExecuteNonQuery() .
|
|
|
|
|
I am having some issue handling an exception thrown in another thread in my UI. My question is how can I handle exceptions from another thread without syncronized the threads in the UI. I would prefer to sync the threads in the class where the method is called. Any suggestions?
Here is my code:
Localized fields
Test t = new Test();
Method that throws the exception
public class Test
{
public void DoSomething()
{
throw new MyCustomException(this,EventArgs.Empty);
}
}
The exception
public class MyCustomException : Exception
{
...
}
This is in the UI. Not multi-threaded
void CallException()
{
try
{
t.DoSomething();
}
catch(MyCustomException ex)
{
lblMessage.Text = "error";
}
}
This is also in the UI. Multi-threaded
void CallExceptionASync()
{
Thread thrd;
ThreadStart ts = (ThreadStart)delegate
{
t.DoSomething();
};
thrd = new Thread(ts);
thrd.Start();
}
|
|
|
|
|
I have created a workaround but I am not satisfied with it. If anyone has a better suggestion please let me know. Here is the workaround:
void CallExceptionASync()
{
Thread thrd;
ThreadStart ts = (ThreadStart)delegate
{
try
{
t.DoSomething();
}
catch(MyCustomException ex)
{
this.lblMessage.Invoke((MethodInvokder)delegate()
{
this.lblMessage.Text = ex.Message;
});
}
}
}
|
|
|
|
|
if the thread throws an exception, and the catch is to touch a GUI Control, then you need Control.Invoke, there is no way around that since that thread is not allowed to touch any Controls.
BTW: A BackgroundWorker has a Completed event which does the invoking automatically, and its event argument holds the exception that may have occurred.
|
|
|
|
|
i need to creat a windows application with many independent window usin the idea of master page in web development
i tried to use tab but its so bad
generaly i need one window that has a panel embedded into it
this panel contains all othe windows when selected from the main one
can any one auggest any idea??
|
|
|
|
|
I don't see what was wrong with the tab, unless you didn't want to see the tabs.
Each panel should contain one control, a user control that you can define elsewhere. That keeps the code cleaner rather than throw all the controls in one form. Does that help?
|
|
|
|
|
the problem is that
1.when i load the program for the first time all tabs will be loaded
and may be many tabs i will not need
2.not every thing will be valid for atab
i need a centeralized application from one windo
or u can say master window as i described
thanks for ur reply
|
|
|
|
|
You can dynamically add and remove tabs as you need them.
|
|
|
|
|
bad design i think
|
|
|
|
|
Why? Internet explorer and Firefox do it all the time. As I recall, Firefox was lauded for having tabbed windows that you create and dismiss at will.
|
|
|
|
|
|
|
In visual studio 2005/2008, create new Item and select 'Mdi Partent'. This will create a toplevel form that can contain other forms.
|
|
|
|
|
aha i know it
but it opens a new window not creates an embedded window
openning many windows is my problem
|
|
|
|
|
EmZan wrote: what is MDI ?
Multi document interface. Allows you to have one master window with many child windows inside. Each child window acts like a regular window (can be minimised, maximised, moved around etc) but only within the confines of the containing window.
|
|
|
|
|
hello i have one problem . i had one frontend in which there are textboxes dropdown . i have to populate data from excelsheet . well i succeed in making connection. but my problem is this that at one time one row data is populated in front end and then i have to click save button. then second row from the excel sheet should populate in my front end automaticaly. is this possible with using dataset . if yes can u guide me how.
thz in advance
|
|
|
|
|
Hi
Is there any open source that supports C# based development on top Mac OS?.
Thanks in advance ...
|
|
|
|
|
Does the Mono Project not support the Mac? I know it is primarily Linux based, but then so is MacOS these days.
|
|
|
|
|
OK, i did guess the same. Seems there is a Windows support also.
Thanks anyway..
|
|
|
|
|
Hello everybody,
Please help me and suggest me how to do this and also tell me if any disadvantages with this approach. Thanks in advance.
I've 10 to 15 ftp addresses and credentials to those ftpsites.Now i've some files which needs to be upload to those sites.My xml file has the information about all ftp site address, credentials ,listening directory(from where to pick the file to upload) and destination directory(where to upload a file) details.And here in each record in xml i've different different intervals(10mins, 15 mins , 60 mins.....). According to that interval i need to pick and upload that file to the respective ftp folder.
I wrote one windows service in that windows service i used thread concept to achieve this. but all my files are uploaded at a time.I tested with some console application.Please help me.Sombody told me don't use threads it will take more processor usage like that, and they suggested me use timer.Please help me, its very urgent to me.
Thanks in advance from my heart.
Avinash
|
|
|
|
|
I have written a similar app. I used a consumer/producer design. Look into this, might help you.
|
|
|
|
|
Hi...
I have some questions:->
1) What is difference between gpedit(Group Policy Object Editor) and gpmc, as both are used for groupPolicy editing...
2) How I can work on GroupPolicy in C#, as gpedit.dll or gpedit.h works only for C,C++.
I download GPMC(Group Policy Management Console), and by that got some COM dlls(Like GPMGMTLib, GPOADMINLib etc). Using these COM Dlls are the only way in C#, or is there any other way.
thx in adv.
Siddharth
|
|
|
|
|
Hi friends
How to create a new blank row in a datagridview when we enter into the last row of a datagridview control ?.It is there in datagrid but not in datagridview control
with warm regards
|
|
|
|
|
There is a boolean property called AllowNew , from memory it appears in both the DataGridView and BindingSource . This property has to be set to true .
If you search MSDN for AllowNew you will get the exact details.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|