|
you can use SQLDMO library to take the backup in asp.net application..
HELLO GUY
|
|
|
|
|
Well as you can see, this is neither the Database nor the ASP.NET forum.
I must get a clever new signature for 2011.
|
|
|
|
|
You want a backup that is initiated in "ASP.NET"? Are you trying to initiate the database backup from a webpage?
|
|
|
|
|
you can use SQLDMO library to take backup using asp.NET application..
HELLO GUY
|
|
|
|
|
Hey guys!
In my setup project, I want my software to appear in the [Open With] context menu for a certain file extension, however if I do so, the file association makes my software the default file association in Windows for that particular extension. I Do want windows to associate my software with the file extension, but I don't want my setup to change the default association for that file extension.
Is that possible?
|
|
|
|
|
Meaning "Don't change the association if one already exists, but create an association if it doesn't"?
Me, I'd avoid doing it during Setup, and just have your application check to see if the file association is there, then prompt the user asking if they would like the assocation created or changed, as appropriate. (Kind of like email programs do if they find they're not the deafult mailer, or Quicktime with image types, etc.)
|
|
|
|
|
The solution is to change the verb of the file association's action to openas in stead of open. The openas verb makes your software appear in the 'Open With' context menu, but doesn't change the default file association which is exactly what I wanted.
Thanks for your reply!
|
|
|
|
|
|
I found the solution ( this[^] message explains more)
Thanks for your reply!
|
|
|
|
|
Hi ,
I have a search on my form[say,parent form]. When I click on search button ,I want to display the results in a modal window and return the selection back to parent form and populate controls with the returned data.
Any suggestions would be appreciated.
Thanks
|
|
|
|
|
This[^] shows how to do what you want. It uses a string, but you can pass any type you wish.
|
|
|
|
|
Do it with events. When the data is returned, post a custom event, and have the first form hook that event and perform the appropriate processing.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
As an alternative, you could create a static class. Just make a form with a textbox, and a button with "DialogResult" set to "OK", and a static wrapper...
public partial class Input : Form
{
public Input()
{
InitializeComponent();
}
public string StringValue
{
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
}
public static class InputBox
{
private static Input _input = new Input();
public static DialogResult ShowDialog(string caption, ref string value)
{
_input.Text = caption;
_input.StringValue = value;
if (_input.ShowDialog() == DialogResult.OK)
{
value = _input.StringValue;
return DialogResult.OK;
}
return DialogResult.Cancel;
}
}
Then use it like this...
private void button1_Click(object sender, EventArgs e)
{
string x = "Some default text";
if (InputBox.ShowDialog("Test", ref x) == DialogResult.OK) MessageBox.Show(x);
}
|
|
|
|
|
That has to be one of the most inappropriate uses of static I have ever seen.
Why on earth would you do it that way, when a simple public property in your Input class (which you already have) does the same thing?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I assume you mean to do something like this?
private void button1_Click(object sender, EventArgs e)
{
Input inBox = new Input();
inBox.StringValue = "Some default text";
if (inBox.ShowDialog() == DialogResult.OK) MessageBox.Show(inBox.StringValue);
}
|
|
|
|
|
Yes. Either that way, or with a constructor requiring the header and default text.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
From what I was reading, it looked like he was asking a question similar to this one. Perhaps he wasn't, my mistake.
The purpose of the static class is to give it "MessageBox-like" usage; e.g., you don't have to use "new MessageBox() " to instantiate that dialog, you can simply call one of the "MessageBox.Show() " overloads.
Regardless, the code I listed above is not thread safe. Here would be a better version:
public partial class Input : Form
{
public Input()
{
InitializeComponent();
}
public Input(string caption, string defaultValue) : this()
{
this.Text = caption;
textBox1.Text = defaultValue;
}
public string StringValue
{
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
}
public static class InputBox
{
public static DialogResult ShowDialog(string caption, ref string value)
{
Input inForm = new Input(caption, value);
if (inForm.ShowDialog() == DialogResult.OK)
{
value = inForm.StringValue;
return DialogResult.OK;
}
return DialogResult.Cancel;
}
}
And a usage example (with threads):
private void button1_Click(object sender, EventArgs e)
{
new Thread(new ParameterizedThreadStart(doMessage)).Start("one");
new Thread(new ParameterizedThreadStart(doMessage)).Start("two");
}
private void doMessage(object msg)
{
string x = msg.ToString();
if (InputBox.ShowDialog("Test", ref x) == DialogResult.OK) MessageBox.Show(x);
}
|
|
|
|
|
All your static class is doing is moving the instantiation out of the original class, and making the input message harder to use.
It also depends on the (unknown) Input form to return "OK" or "Cancel" rather than "Yes", "No" or "Cancel".
Why make it static? If all you want to do is hide the instantiation, put it in s non-static method and you get exactly teh same result, but better contained. You could make that static if you really wanted to, but I wouldn't necessarily bother.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
|
i have store procedure which tooks 10 mints to execute so it will get time out in my application.
i think we can set Connection.Timeout in web config.
can any one tell me where to set that in web config??
|
|
|
|
|
Use <connectionstrings> in Web.Config like this
<connectionStrings>
<add name="TestConnectionString" connectionString="Data Source=Test_XXXX;Initial Catalog=DB_Name;Integrated Security=True; Connection Timeout=200;" providerName="System.Data.SqlClient"/>
</connectionStrings>
Go through this link, You can get good idea about connection strings.
connectionstrings[^]
P.S: Check why that procedure taking two much time (10 minutes).
Happy Coding
Regards,
Eswar
|
|
|
|
|
Thanks for the swift reply..
like this means..how?? because i want syntax...where to add and ahta i have to add
i check link given by you...but it has nt mention any where....any thing related to time out
|
|
|
|
|
Mugdha_Aditya wrote: ike this means..how?? because i want syntax...where to add and ahta i have to add
For Web.Config concept See this http://msdn.microsoft.com/en-us/library/w7w4sb0w(v=VS.80).aspx[^]
Mugdha_Aditya wrote: i check link given by you...but it has nt mention any where....any thing related to time out
Link is only about connection strings with respect to different databases & different parameters.
Are you want sample syntax of web.config file?
|
|
|
|
|
i waant to add timeout hours in web config...
i want sample for tht... so i can add same thing in my web config for time out
|
|
|
|
|
10 minutes? Sounds more to me like you need to refactor/refine your stored procedure and schema a bit. I've written queries that take as long as three seconds, but never *minutes*. Believe me when I say the timeout is the least of your worries.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|