|
|
Carefull! He might send you a bag of money worth $.05 cents!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i want to insert data into sql server (in C#)
one of the attributes (Article) id define as varchar (size 8000 - the MAX)
i want to insert into Article string lets call the variable S (size lower then 8000 and higher than 1000) but its doesnt work, but if S is define in size 100 its working .
if somebody knows what is the problem i will be glad if he will explain to
me .
eyalso
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
not working = the insert query doesnt work
eyalso
|
|
|
|
|
In what way isn't it working? Doesn't it insert anything? Does it insert the wrong value? Do you get an error message?
---
b { font-weight: normal; }
|
|
|
|
|
Hi.
Assume that we have an extender control (such as tooltip).
How can we add a Custom TypeEditor for extended property (such as tooltiptext).
Reza
|
|
|
|
|
Hi,
I want to write a report designer but I don't know where I must begin .
Please help me.
Thanks
|
|
|
|
|
Hi, I just wish to know if exist some way of inicialize a vector (all positions) with the same value, without doing any for....
|
|
|
|
|
You'll need to be a bit more specific. C# doesn't actually have a class named Vector. It has ArrayList and List<t> which are essentially vectors (just don't have the name).
What value do you want them to be initialized to?
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
here's what I'm sure is an easy one...
I have a project with 5 different windows forms. One is the main program form and 4 of them are displayed by clicking a button on the main form. I'm trying to get each form centered on the main form (they are all modal dialogs). I've chosen "center on parent" on the property sheet for each form, but each form is still spawning what seems to be randomly on screen. I don't think that the main form of the project is set as the parent form for each of the other forms. Is this what the problem is and if so how can I go about giving each form a child relationship to the main form?
Thanks,
John
BTW I'm using Visual Studio 2005 Standard Edition.
-- modified at 21:06 Friday 9th December, 2005
|
|
|
|
|
You are correct. For them to properly center they must have the parent form set. To do this just pass in the parent form as the first paramater to the ShowDialog() method. For instance
public void OnButtonClick(object sender, EventArgs e)<br />
{<br />
SomeForm child = new SomeForm();<br />
if ( DialogResult.OK == child.ShowDialog(this) )<br />
{ <br />
...<br />
}<br />
}
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Thanks a bunch Jared, got it working
Thanks,
John
|
|
|
|
|
:confused Hi,
I'm probably going to get hammered for this-- but here goes........
I'm trying to learn how to debug programs. Specifically, Windows Form Apps.
VS .NET 2003
I've found two kinds of tutorials:
Type 1: Tells you how to set a breakpoint
Tells you how to step in, step out etc.
How to set a watch window etc..
Type 2: Tells you stuff that is so advanced that it's of
no use for "practical" learning... "eax", "stack trace".
Sure, lots of people know this stuff, but what the heck do you do if you don't?
ps- I know what "eax" and a "stack trace" are but it hasn't helped me
learn how to use the debugger.
So here's the fundamental problem I'm having-->
I design a WinForm w/ buttons, TextBoxes, graphs etc...
The program compiles. I run it. Something doesn't work right.
I decide to debug it.
I decide to set a breakpoint.
I run "debug"
The WinForm launches (or doesn't launch until a few "step over" clicks)
And now the "step over" icon and it's friends are "grayed out". Now I'm in this frozen state between
the WinForm and the debugger window with no idea what to do...
Now what? How do I productively use the debugger and also "work" with the
events that fire and make things happen that I can see?
Thanks in advance.....
|
|
|
|
|
SkunkedWorks wrote: Type 2: Tells you stuff that is so advanced that it's of
no use for "practical" learning... "eax", "stack trace".
Debugging can be very advanced and difficult. IMHO the best way to learn is to
- try
- fail
- figure out why you failed
- repeat
SkunkedWorks wrote: And now the "step over" icon and it's friends are "grayed out". Now I'm in this frozen state between
the WinForm and the debugger window with no idea what to do...
Not sure what state you've gotten into here but pressing F5 should get you running again
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Hi All...
I writing some application that in it i have dynamic creating button.
In this case i created one method that will call in each button click.
How can i know what button was press ??
I want to save each button in Hash table and by the method "GetHashCode" to get the number of the button that was press.
But i don't know how to "Set" hash code ...
Someone can help me ?
Thanks.
|
|
|
|
|
Okay, with your idea, you can do the following when you create the buttons, assuming you have a Hashtable named buttonDict and an int named buttonIndex:
Button b = new Button();
b.Text = "Button " + buttonIndex.ToString();
buttonDict[ b ] = buttonIndex;
buttonIndex++; and, then, in your event handler
private void AllButton_Click( object sender, System.EventArgs e )
{
int clickedButtonIndex = -1;
if( buttonDict.ContainsKey( sender ) )
{
clickedButtonIndex = Convert.ToInt32( buttonDict[ sender ] );
}
} However, I think that you're keeping around a Hashtable for no reason. You could, alternatively, do the following in the place where you create your buttons:
Button b = new Button();
b.Text = "Button " + buttonIndex.ToString();
b.Tag = buttonIndex;
buttonIndex++; and in your general button click event handler:
private void AllButton_Click( object sender, System.EventArgs e )
{
int clickedButtonIndex = -1;
Button b = ( Button ) sender;
if( b.Tag != null )
{
clickedButtonIndex = Convert.ToInt32( b.Tag );
}
} I hope that answers your question sufficiently.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hello, everyone, I have and application that start when the windows(2000) start, every time that the application run read the directory and put it in the registry, i have installed the program in c:\safeupdate\directory.exe but when the application star with windows the directory is c:\documents and setting\administator\directory.exe WHY?, How can i obtain the real directory?, my code is the next:
Private void Form1_Load(object sender, System.EventArgs e)
{
string pathNow = Directory.GetCurrentDirectory()+@"\directory.exe";
Registry.LocalMachine.OpenSubKey(@"software\microsoft\windows\currentversion\run",true).SetValue("directory",pathNow);
}
I need the real directory because in the registry put the wrong directory and the next time won't run the application because doesn't exist inthe c:\document and setting\directory.exe, please help me.
Greetings from Tijuana Mexico
|
|
|
|
|
RobertoTjMx wrote: string pathNow = Directory.GetCurrentDirectory()+@"\directory.exe";
Try replacing the above line with the following:
string pathNow = Application.ExecutablePath;
Or, with the following:
string pathNow = Application.StartupPath + "\\directory.exe";
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Thanks, I solved my problem.
|
|
|
|
|
Application.StartUpPath
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
i try to make HttpWebRequest
with this code
----------------------
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.elections.ps/afindcenter.aspx");
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream receiveStream = response.GetResponseStream();
-----------------------------
when i test it in localhost it work %100
but when i upload it to my host i recive this error message
***********************
Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Source Error:
Line 36: // Set credentials to use for this request.
Line 37: request.Credentials = CredentialCache.DefaultCredentials;
Line 38: HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Line 39:
Line 40: // Get the stream associated with the response
Palestine
|
|
|
|
|
Can you give us more information about the host? Specifically do you know what process your app is running under? Also what is your relationship with the specified website?
CredentialCache.DefaultCredentials is essentially the credentials your application is running is. When you run it on your local box, this represents your credentials. If your host (I'm assuming it's a WebServer somewhere) is running as a completely different user so this would have a different value and explain why you are denied access
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
information about the host?
i use hostingrightnow.com hosting with .Net 2.0
relationship with the specified website?
no relationship but this web site any one can open it (normal web site) as yahoo gmail and in my local host i can open without any CredentialCache but i see it mircrosoft web site and in use it
Palestine
|
|
|
|
|
Tareq Abuzuhri wrote: my local host i can open without any CredentialCache but i see it mircrosoft web site and in use it
In this case, since the end result is that the app will be hosted on a web site you probably don't want to do this. All having that line does is enable NT and Kerberose authentication. Since this is a public website you don't need to add that line.
I'm not sure why you are getting that error then. The only explanation I can come up with is that http://www.elections.ps/afindcenter.aspx is actively denying your host. I don't know of any good way to determine if that is the case or not though.
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|