|
asif_aslam wrote: Hi,
I want to know,How to know Store Procedure Input and Output parameters.
What I want.
When I pass any Store Procedure Name.it's return that Store Procedure Input and Output parameters.
Help me out
it's very arrgent.
Thanks
Try this query
select specific_name, parameter_name, data_type, character_maximum_length, parameter_mode from information_schema.parameters where specific_name = @spName<br />
|
|
|
|
|
SqlConnection connection = .....
SqlCommand cmd = new SqlCommand();
cmd.Connection = connection;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = StoredProcedureName;
SqlParameter param = new SqlParameter("name", value);
//param.Direction = ParameterDirection.Input; // by default
//param.Direction = ParameterDirection.Output;
//param.Direction = ParameterDirection.InputOutput;
cmd.Parameters.Add(param);
|
|
|
|
|
Hi everyone,
I use the OLE connection to read data from excel file;
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFileName + "; Jet OLEDB:Engine Type=5;" + "Extended Properties=\"Excel 8.0;\"");
OleDbDataAdapter SheetAdapter = new OleDbDataAdapter("select * from [" + strSheetName + "]", conn);
But when using the method to read the excel data like this:
111111111
2222(ds)/1232(jjj)
It just return NULL to the dataset row.
I really don't know why ?
Can you help me please?
Thanks in advance.
|
|
|
|
|
Clearify question:
the 11111111 is returned well,
but can't get the next row - 2222(ds)/1232(jjj)
|
|
|
|
|
I want to display a form, which(name of form) is stored into a table.After firing query to that table I am getting appropriate value (e.g "frmSTART") into a string variable(myfrm = "frmSTART"),
now how can I treat a string variable value as an object?
So that I can write:
myfrm nSTART = new myfrm ();
nSTART.Show();
Hallo
|
|
|
|
|
Hello,
What you asked for is not possible!
.)
If you know all the possible class names during design time, you simple could make a switch case over the returned string.
string myform = actual_returned_string;
switch(myform)
{
case "test1":
{
MyTest1 t1 = new MyTest1();
break;
}
case "test2":
{
MyTest2 t1 = new MyTest2();
break;
}
default:
break;
}
.)
If you have to make it more dynamic, then you have to look into reflection.
Therefore you should know the namespace of youre formclasses.
You could use a method like this, which returns you a Form to Show.
using System.Reflection;
public System.Windows.Forms.Form GetFormByName(string _name)
{
Type t = Type.GetType(_name);
if (t != null)
{
ConstructorInfo c = t.GetConstructor(Type.EmptyTypes);
Object o = c.Invoke(new Object[0]);
return o as System.Windows.Forms.Form;
}
else
{
return null;
}
}
And you can call it like that:
string namespace =
string myform = namespace+actual_returned_string;
System.Windows.Forms.Form actForm = GetFormByName(myform);
Hope it works for you!
All the best,
Martin
|
|
|
|
|
I don't know why you got voted a 2 for that - I thought the reflection idea was sound.
|
|
|
|
|
Hello,
Colin Angus Mackay wrote: I don't know why you got voted a 2 for that - I thought the reflection idea was sound.
I have also no idea!
It would also be interesting for me to know way, cause I'm using reflection in my application.
So thank's for youre statement!
All the best,
Martin
|
|
|
|
|
Probably because the answer was above the person's comprehension.
|
|
|
|
|
ednrgc wrote: Probably because the answer was above the person's comprehension.
If someone gave me an answer that I didn't understand then I'd follow it up with a request for clarification. Oh, Well....
|
|
|
|
|
Hi
I have to detect either sql server (any version) and db2 are installed on my system or not through c#. Can someone tell me how can i do that?
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
|
Hi there,
What are the controls that can be added as UIElements? can a form be added as a UIElement in dockpanel? Any examples?
|
|
|
|
|
say i have my own defined class, MyClassA, MyClassB
MyClassB b;
MyClassA a = new MyClass(1,"MyName", b);
MyClassA aCopy = new MyClassA();
aCopy = a;
This will make aCopy point to the same object as a, being a reference. I want aCopy to be a distinct object from a, but equal in the sense that it has all its member-data equal in value to those of a. Is the best way to make a copy of another user-defined class through the copy-constructor?
Therefore:
MyClassA aCopy = new MyClassA(a);
provided the copy ctor is provided for MyClassA.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
That is certainly one way to do it. .NET also includes the ICloneable interface for the same purpose. Objects which could be copied would implement the interface's single method Clone() that would return a new copy of the object. From my reading, however, the use of this interface seems to be discouraged now due to the lack of consistent semantics regarding the copying act. That is, whether an object created a shallow copy or a deep copy is dependent on a particular implementation of ICloneable. The interface did not specify one way or the other. Plus, having been introduced in .NET 1.0 before generics, client use of ICloneable always required an ugly cast back to the original object type (because the Clone() method return an object of type System.Object). Nonetheless, in my opinion, creating a custom Clone() method that returns a new object of the same type is preferable to a copy constructor. In my mind, the intent of:
MyClassA a = new MyClass();
MyClassA aCopy = a.Clone();
is more obvious than:
MyClassA a = new MyClass();
MyClassA aCopy = new MyClassA(a);
-Phil
|
|
|
|
|
Hello everyone!
Hey, so I need to use System.Net.Sockets.Socket.BeginAccept() , but I'm forced to use System.AsyncCallback to pass a callback function... What if I want to use my own event instead? How can I do that? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Can someone explain why numbers are being dropped off in this regular expression replace statement??
string phone = "1012345678912345";<br />
string newphone = Regex.Replace(phone, @"^((?<country>[1])([ ]|.|-))(\(|\[)?(?<area>\d{3})(\)[ ]?|\][ ]?|.|-)?(?<prefix>\d{3})(.|-|[ ])?(?<suffix>\d{4})[ ]?(x|X|#|.)?(?<ext>\d{0,5})$", "${country} (${area}) ${prefix}-${suffix} #${ext}"); <br />
<br />
newphone = newphone.TrimEnd('#');<br />
newphone = newphone.Trim();<br />
<br />
Console.WriteLine(newphone);<br />
The output is: 1 (123) 567-9123 #5
What it should be is 1 (012) 345-6789 #12345
Why is a number being removed between each storage area??? Thanks for your help.
|
|
|
|
|
How is this working at all? I tested the Regular Expression and am getting a grouping error.
|
|
|
|
|
For some reason it cut out a lot of it....
I'll try it again.
string newphone = Regex.Replace(phone,
@"^((?<country>[1])([ ]|.|-))(\(|\[)?(?<area>\d{3})(\)[ ]?|\][ ]?|.|-)?(?<prefix>\d{3})(.|-|" +
"[ ])?(?<suffix>\d{4})[ ]?(x|X|#|.)?(?<ext>\d{0,5})$",
"${country} (${area}) ${prefix}-${suffix} #${ext}");
Well i can't get it to use the entire expression for some reason... it cuts out prefix and suffix when trying to post as well as a a few things within the expression.
|
|
|
|
|
check the "ignore HTML tags" checkbox.
|
|
|
|
|
Well just in case anyone wants to see it, or use it in the future here it is... Thanks again ed...
<code>
string phone = "1012345678912345";
string newphone = Regex.Replace(phone, @"^((?<country>[1])([ ]|\.|-)?)(\(|\[)?(?<area>\d{3})(\)[ ]?|\][ ]?|\.|-|[ ])?(?<prefix>\d{3})(\.|-|[ ])?(?<suffix>\d{4})[ ]?(x| #|\.)?(?<ext>\d{0,5})$", "${country} (${area}) ${prefix}-${suffix} #${ext}");
newphone = newphone.TrimEnd('#');
newphone = newphone.Trim();
Console.WriteLine(newphone);
</code>
|
|
|
|
|
Excellent routine. It will definitely come in handy.
Thanks,
Ed
|
|
|
|
|
At first glance, I would guess you would have to qualify the periods with \
|
|
|
|
|
Hey perfect that was it... Thanks a lot for your help... I completely forgot periods meant any single character.. stupid me...
|
|
|
|
|
Hi,
I'm still new to C# so please bear with me.
I am trying to write a windows program, and am struggling to find info for the following things :-
1. How to get an event to trigger when the user clicks the mouse button anywhere on the window. I would like a container thats will contain grahics in the end. But when the user clicks the button I would like to get the Co-ors (X/Y) for where the user clicked.
2. I would like to show a flashing icon on the screen at particular X/Y co-ords, then when the Co-Ords have changed it will update and flash in a different place. I would like to have multiple flashes. Be able to add and remove the flashes. I am assuming I would need to create a new class for this object??
Any help or points to articles would be greatly appreciated.
Regards
Tony
|
|
|
|