|
You can manually add the QueryString when you have a button or a link that redirects to anew page.
For example, from the code behind you'd do something like
request.redirect("http://www.somewhere.com/somepage.aspx?myvar=val1&myvar2=val2")
from javascript you'd do something like
window.location("http://www.somewhere.com/somepage.aspx?myvar=val1&myvar2=val2")
Keep in mind the security issues that may come from using the query string, and also that there is a max length (I don't remember what it is).
|
|
|
|
|
I'm working on a database centred program, and I have written a program which runs all my SQL scripts to install the database. My problem is, if I want to do a clean install, dropping the database often fails because there are users connected. So is there a way I can programatically drop all active connections to a database, so I can delete it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
In essence. I am using MSDE.
Thanks for any help.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Here is my thought, again I don't know if this would apply because I don't know the exact situation. Assuming you have access to this database, you could execute a stored procedure that would wrap a few different calls, first, you would want to call sp_who to get a list of all valid SPID 's. For each valid SPID , call KILL which will terminate the specified user process. For more information check out this[^] page. Let me know if you think this may or may not work.
- Nick Parker My Blog | My Articles
|
|
|
|
|
That looks a treat - thanks muchly
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
I was trying the Visual inheritance walkthrough given here
After inheriting a form using option of adding "Inherited Form",
when I opened the design view of inherited form, the form designer
showed error, that form1(from which inherited form was inherited) is
not build or something like form1 is not present..?
I have browsed through the code generated for the inherited form,
and the main method was also missing..????
I copied the main method of form1 into form2(inherited) and run the
application by setting the form2 as startup object.. Form got
displayed successfully?
Why so...?
Regards
Jawwad Alam
|
|
|
|
|
Hi All,
I'm using the HierarGrid
I'm facing a problem while allowing editing in it.
I'm able to do edit/add/delete on Parent Grid, But When I try to do the same for children it gives error for viewstate.
I'll be glad if anybody could help me out.
Thanks
JATSUN
|
|
|
|
|
|
I used the excellent article: Create an Automation Add-In for Excel using .NET, By Govert van Drimmelen
http://www.codeproject.com/dotnet/excelnetauto.asp and everything is ok but the Naddin displays inherited system functions as well as the Add2 custom function to users. How do I hide the inherited system functions from users in excel, and is there a way to have function sub-categories" Thanks
Thanks for any assistance.
ce...stetson
|
|
|
|
|
It would be best if you posted your question to the author within the forum on their specific article.
- Nick Parker My Blog | My Articles
|
|
|
|
|
4 questions and no replies on that specific article's forum. Any suggestions on add-ins? Thanks.
ce...stetson
|
|
|
|
|
I have Form1 with the connection, dataadapter and dataset components.
On Form2 I want to use the dataset from the Form1. I want to have the possibility to use the visual designer when I configurate the DataGrid from the Form2.
What is the best way to do this? I tried to use a typed dataset but I don’t understand how to fill the dataset from the second form. Shell I use an additional set of connection and dataadpter componets? I think it has to be a better solution.
|
|
|
|
|
hi,
No need to create additional set of data adapater to pull the data which is already populated. What you can do is write a parametrised constructor which will accept a dataset as parameter. When ever your are trying to call the second form, try to call that parameterised constructor of that fom and pass your dataset which is in the first form.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I ran into a problem when handling drag and drop events. I'm dragging (copying) an item from a treeview to a listbox. The first drop works fine. After that I lose all DragOver events in my listbox!!!! Anyone have an idea?
Code:
private void commands_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
Point here = commands.PointToClient(new Point(e.X, e.Y));
string command = e.Data.GetData(DataFormats.Text).ToString();
int location = commands.IndexFromPoint(here.X, here.Y);
dragDropInProgress = false;
dataNeedsSaving = true;
commands.Items.Insert(location, FormatedOutput(command, here));
commands.SelectedIndex = -1;
commands.SelectionMode = SelectionMode.MultiExtended;
commands.SetSelected(location, true);
Trace.WriteLine("Dropped "+command, "NavImport");
e.Effect=DragDropEffects.Copy;
}
private void commands_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
{
Trace.WriteLine(e.Data.GetDataPresent(DataFormats.Text).ToString() + ":" + commands.Items.Count, "NavImport");
if (e.Data.GetDataPresent(DataFormats.Text) == false || commands.Items.Count == 0)
{
e.Effect = DragDropEffects.None;
return;
}
e.Effect = DragDropEffects.Copy;
dragDropInProgress = true;
Point location = commands.PointToClient(new Point(e.X, e.Y));
commands.SelectedIndex = -1;
commands.SelectedIndex = commands.IndexFromPoint(location);
}
private void objectView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
Point here = new Point(e.X, e.Y);
TreeNode drag = objectView.GetNodeAt(here);
if (drag.Text.StartsWith(ParentNodeName))
return;
string command = "<" + drag.Parent.Text + ":" + drag.Text;
objectView.DoDragDrop(command, DragDropEffects.Copy);
Trace.WriteLine("Dragging "+command, "NavImport");
commands.SelectedIndex = -1;
commands.SelectionMode = SelectionMode.One;
Trace.WriteLine("Current control state :"+commands.AllowDrop.ToString(), "NavImport");
}
This signature left intentionally blank
|
|
|
|
|
I found the problem!!!!!
theRealCondor wrote:
commands.SetSelected(location, true);
This seems to put the control off the deep end. Once I changed this to just work with SelectedIndex all worked well, drag and drop functioned very well, and the control never 'winked out' or stopped responding to drag events.
This signature left intentionally blank
|
|
|
|
|
The form I am dealing with pops up in the middle of the application only half time time. The other half the time it goes into the upper-left corner.
If I set a break point inside the form to check what the parent is - it's always null.
But it's null for all the forms in our app, yet this is the only form that is acting funky.
I was wondering if anyone else ran into problems with setting StartPosition to CenterParent.
Thanks,
Elena
|
|
|
|
|
I have seen this. However I have not taken the time to determine what I'm doing when it works and what I'm doing when it does not work. (ie. form.Show() vs. form.ShowDialog())
This signature left intentionally blank
|
|
|
|
|
elena12345 wrote:
I was wondering if anyone else ran into problems with setting StartPosition to CenterParent
You need to make sure your child form instance sets the it's Parent property before you display your form, that is assuming you are setting you StartPosition to CenterParent . If you don't have a parent, just set the StartPosition to CenterScreen to get the form centered on the screen.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Exactly. If you set the CenterParent property before the parent is known, it will have no effect.
For instance If you set the CenterParent in the designer, it will be set when the constructor calls the designer generated code, at which point the parent is still unknown. The way to go here is either:
Create a constructor that takes the parent form as a parameter, and then set the Parent property before calling the designer generated code
Or:
When you create the child form in the parent form, first set the Parent Property, then the StartPosition property and then call the Show(Dialog) method.
|
|
|
|
|
Hie,
I found this syntax error.
If (Persist.Checked = (true)) {
setPasswordCookies(UserPass.Text, UserEmail.Text);
}
What is the issue?
Thanks.
|
|
|
|
|
|
One = sign is assignment while two == is equality. You can just say the following if you want:
if(Persist.Checked)
{
setPasswordCookies(UserPass.Text, UserEmail.Text);
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
What type of connection does the SqlClient use? Like ado or ole db or something??
/\ |_ E X E GG
|
|
|
|
|
ADO and OLEDB are not connection types. SQL Client uses a direct network connection to the SQL Server and communicates using a proprietary optimized dialect.
ADO and OLEDB are programming interfaces that abstract the database and expose a consitent, generalized API that works on any database with an ADO or OLEDB data provider.
What are you looking into? Why the question?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|