|
I don't know if this will work with SOAP, but you get the idea: A property that is used for serialization and another that is used in C# code.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Hi all! How i can to invoke SQL Function through SqlCommand class,
what syntax i should use in CommandText and what value i should define in CommandType
THANK
|
|
|
|
|
Are you using an Article or tutorial? If not you should, there are many Database related articles here on Code Project. Use the Site Menu on the left side of the page to find them.
|
|
|
|
|
For scalar UDFs (which return a single value) use:
select dbo.MyUdfName()
For table-valued UDFs (that return a resultset) use:
select * from dbo.MyUdfName()
Regards
Andy
|
|
|
|
|
Hi all
I would like to trigger a function (writing a time stamp)
when Visual Studio is running in Debug Mode and an exception is thrown by the code.
I am basically interested in the event OnExceptionRaised in Visual Studio.
I saw that there is some DebuggerEventClass but it is something internal that cannot be used.
Is there any way to do that? I noticed that VIsualStudioIDE supportsa COM component model
but I think that this is not also supported.
Kind Regards
ManuStone
|
|
|
|
|
Hi,
I have an mdi parent form (frmMain) and a child form (frmChild)
Using c#, How is it possible to set the height of the child form as long as that in the frmMain i.e. the parent form.
At present the frmChild appears in the middle of frmMain but there is room for the frmChild's height to be increased.
Tried frmChild.height but .height does not appear in the intellisense.
Thanks
|
|
|
|
|
A form has a Size property.
ChildForm child = new childForm();
child.MdiParent = this;
child.Size = new Size(this.Width, this.Height);
child.Show();
This will set the height and width of the child form to be the same as its parent form.
|
|
|
|
|
I get a scrollbar on the parent form because the child form seems to be too long.
Any thoughts please?
This is what I have
Form frmNew = new frmChild();
frmNew.MdiParent = this;
frmNew.Size = new Size(frmNew.Width, this.Height);
frmNew.Show();
|
|
|
|
|
frmNew.Size = new Size(frmNew.Width, this.ClientSize.Height);
|
|
|
|
|
That still gives a scrollbar.
|
|
|
|
|
Wierd, I'm sure that's how I've done it before!
This way works if you want width and height:
In your child form's load event put...
this.Dock = DockStyle.Fill;
|
|
|
|
|
It depends how you will use your child form. I cant seem to get the child form to appear within the client rectangle without scroll bars apart from hacking it. So here is a couple of options you could have a look at.
1. You can set the child forms Dock = Fill.
2. You can set the child forms WindowState = FormWindowState.Maximized.
3. You can set the childs size to parentForm.ClientRectangle - x. (hack i know)
Sorry I am all out of ideas after that. The scroll bars seem to appear no matter if i set the hscroll etc props.
|
|
|
|
|
Solved it by doing this:
frmNew.Size = new Size(frmNew.Width, this.Height - 80);
Thanks
|
|
|
|
|
You may want to check the value of this.Height before you run this line of code. Setting the size to a negative number could be detrimental to the execution of your application.
|
|
|
|
|
Ok, I've checked the code that I used in a previous project and this works fine:
this.Height = this.Parent.ClientSize.Height;
Using this.MdiParent.ClientSize.Height doesn't however - strange!
|
|
|
|
|
Is there any code in C# to get GUID of network card.
Thanks.
The great pleasure in life is doing what people say you cannot do.
|
|
|
|
|
GUID of network card? Do you mean the Mac Address? If so, you can use WMI to retrieve it:
public string GetMACAddress()
{
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
string address = string.Empty;
foreach (ManagementObject mo in moc)
{
if (MACAddress == string.Empty)
{
if ((bool)mo["IPEnabled"] == true)
address = mo["MacAddress"].ToString();
}
mo.Dispose();
}
address = address.Replace(":", string.Empty);
return address;
}
|
|
|
|
|
Thanks Pete O'Hanlon for your reply, but i need GUID which also called UUID.
Any Idea please.
The great pleasure in life is doing what people say you cannot do.
|
|
|
|
|
Hi,
I have recently got a test server running so the employees can input test data without needing worry about if they mess up.
So I written a small c# windows app that the user runs and it has two buttons "test server" or "live server".
The problem is I want to indicate to the user what system they are in, but I cant mod the exe so can I execute the exe within a windows form app, so the exe is contained inside the windows form and I can place some text on the Form like "You are in the Test Server",
how can I get the exe to load within a form?
|
|
|
|
|
What you would have to do is set the form so that it is MDI and then use WinAPI to get the handle of the main form for the application you want to embed and set its parent (done through API) to the .NET application that you are developing.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
How can i add drop down list to datagridview for one column.
usharani
|
|
|
|
|
|
Get this[^]
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
Hi there,
I came across this strange thing, i don't know how to handle it. Maybe a pretty stupid question or a case of RTFM - but i couldn't find any refference...
Following code works just fine:
<br />
WebClient webClient = new WebClient();<br />
webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");<br />
webClient.Headers.Add("abc", "123");<br />
byte[] postArray = Encoding.UTF8.GetBytes("submitting some data here...");<br />
byte[] responseArray = webClient.UploadData("MyServer", postArray);<br />
Console.WriteLine("Response received was : " + Encoding.ASCII.GetString(responseArray));<br />
Console.Read();<br />
BUT if i change the HTTP Header to something like
webClient.Headers.Add("abc[OBJECT_ID]", "123");
i get an error in the next line (byte[] postArray...) saying:
An unhandled exception of type 'System.ArgumentException' occurred in system.dll
So it's the square brackets causing the issue. Do i need to escape them in any way???
thanks in advance,
- ajs
|
|
|
|
|
hi
i have a comboBox that binded to a field in database, and i want to add new item to my binded comboBox dynamically, how to do that ?
thanks
|
|
|
|