|
Hi,
forget Reflector, it won't tell you about locals. You need either the source files or, maybe, the PDB file.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Anir1982 wrote: Kindly let me know how do I get the variable names.
You can't and that is the end of it. It would require that reflection exposes the implimentation of the method rather than the interface.
What use would it be if you could in the long run? You cannot [or should not] be able to change the state of internal variables. Local variables only have scope within the life of a single call to the method. How or when would you be able to constructively use the instance or local variables of a class or method?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
How Can I Select any Row In DataGridVeiw
|
|
|
|
|
example :
dataGridView1.Rows[3].Selected = true;
|
|
|
|
|
Thanks But How Can I MOve The ScrollBar To That Row
|
|
|
|
|
dataGridView1.FirstDisplayedScrollingRowIndex = 3; // set the index of row here..
|
|
|
|
|
I Am Greatfull.
Thanks Again
|
|
|
|
|
Hello!
I have a very simple question. If I want to create an event to my class I can use the EventHandler delegate like this:
public event EventHandler OnLog;
But the EventHandler delegate takes two arguments (the sender and an EventArgs object). If I don't want to have those arguments in my event, is there any other event handler delegate that takes zero arguments or so, or do I have to create the delegate myself?
Regards
|
|
|
|
|
Just use:
if(OnLog != null)
{
OnLog(null, EventArgs.Empty);
}
|
|
|
|
|
or define your own delegate.
or use an Action<type> so you can have exactly one argument with a type you choose.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi all,
I have the following
sda.fill(ds);
string xmlDs = ds.GetXml();
WebRequest req = null;
WebResponse rsp = null;
try
{
string fileName = xmlDs;
string uri = "http://www.website.com/Pages/CongratulationsListener.aspx";
req = WebRequest.Create(uri);
//req.Proxy = WebProxy.GetDefaultProxy(); // Enable if using proxy
req.Method = "POST"; // Post method
req.ContentType = "text/xml"; // content type
// Wrap the request stream with a text-based writer
StreamWriter writer = new StreamWriter(req.GetRequestStream());
// Write the XML text into the stream
writer.WriteLine(fileName);
writer.Close();
// Send the data to the webserver
// SendRequest(uri);
rsp = req.GetResponse();
rsp.Close();
}
catch (WebException webEx)
{
}
catch (Exception ex)
{
}
finally
{
if (req != null) req.GetRequestStream().Close();
if (rsp != null) rsp.GetResponseStream().Close();
}
My listner page (CongratulationsListener.aspx) doesnt seem to get any Xml data?
Can any one advice please?
Thank you in advance.
|
|
|
|
|
How I Show System Date And Time In Label
I Perform This task Bt Not Found Actual Result
I USe This Code For Date And Time
Using System.Diagnostics;
Load_Form
DateTime dt = DateTime.Now;
label1.Text = dt.ToShortTimeString();
-------------------------------------
|
|
|
|
|
Bad subject line.
DateTime.Now does gives the system time. What is it giving in your case?
|
|
|
|
|
It given me Sytem Time bt it not change when my system time change.
|
|
|
|
|
Of course it doesn't you've not told it to! All you've done is take the current date/time and converted it to text to display in a label. If you want it to update, you need to tell it to - computers are not mind-readers!
Set up a timer, make it poll every second, and in the Tick event update your label to the current date/time just as you did in your original code.
|
|
|
|
|
yes you right..
i take timer and set it interval = 1oo
now how i implement this ??
|
|
|
|
|
There are so many examples of doing this on the internet, that it is obvious that you did not even attempt to do any research for yourself.
Now stop trying to get other people to write your code for youyou'll never learn anything that way. Fire up google and do some research for yourself.
Post back here with some example code, if it goes wrong.
Actually, you don't need to google, all the information you need has been given to you in the answers in this thread. Now have a go for yourself.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Your computer is stupid. You will need to tell it to refetch date.
|
|
|
|
|
d@nish wrote: Your computer is stupid.
mine is too
|
|
|
|
|
Doesn't this also yeild an yet another gem-philosophy in the world of computing?
GIGO[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Hi All
Here is a cut down version of the code that I am working on and having problems with
The first Code Block works fine
public class MyBase<T>
{
public string MyName;
public object MyValue;
public T ValueTyped
{
get {return (T)MyValue; }
set { MyValue = (object)value; }
}
public MyBase(string NewName, T DefaultValue)
{
MyName = NewName;
ValueTyped = DefaultValue;
}
}
public class MyString : MyBase<string>
{
public int MyMaxLength = 50;
public MyString(string NewName, string DefaultValue, int MaxLength)
: base(NewName, DefaultValue)
{
MyMaxLength = MaxLength;
}
}
public class MyInt : MyBase<int>
{
public int MyMaxValue = 100;
public MyInt(string NewName, int DefaultValue, int MaxValue)
: base(NewName, DefaultValue)
{
MyMaxValue = MaxValue;
}
}
public class Testing
{
public void test()
{
MyString _string = new MyString("Name","",20);
MyInt _int = new MyInt("Size",10,72);
}
}
Up to here all is OK. The next Code block falls over. I am try to create an array that can contain MyString and MyInt classes using the base class MyBase so that it can be used like in class testing2.test
public class MyBaseArray
{
List<MyBase> ListAll = new List<MyBase>;
public void AddMyBase(MyBase Item)
{
ListAll.Add(Item);
}
public MyBase Find(string name)
{
foreach (MyBase _MyBase in ListAll)
{
if (_MyBase.MyName == name)
{
return _MyBase;
}
}
throw new Exception("Item Not in list");
}
}
public class testing2
{
public void test()
{
MyBaseArray MyBases = new MyBaseArray();
MyBases.AddMyBase((MyBase)new MyString("Name1","Fred",20));
MyBases.AddMyBase((MyBase)new MyInt("Size1",10,72));
MyBases.AddMyBase((MyBase)new MyString("Name2","George",20));
MyBases.AddMyBase((MyBase)new MyInt("Size2",8,72));
MessageBox.show(MyBases.Find("Name2").ValueTyped);
int FontSize = MyBases.Find("Size2").ValueTyped
}
}
The Idea works If I remove the Generics from MyBase and make ValueTyped return an Object.
The question, is it posible to have a array of MyBase where I can use .ValueTyped to return a string for MyString and an int for MyInt.
without have to do any type casing?
MessageBox.show(((MyString)MyBases.Find("Name2")).ValueTyped)
int FontSize = ((MyInt)MyBases.Find("Size2")).ValueTyped
or
MessageBox.show((string)MyBases.Find("Name2").ValueTyped)
int FontSize = (int)MyBases.Find("Size2")).ValueTyped
The original code above is far more readable.
Generics did seem like the way to go until I hit this problem.
Thanks any help.
James
|
|
|
|
|
I suspect the problem is because your list is of MyBase but MyBase<int> and MyBase<string> are actually different types. I'll try and have a think of a solution.
|
|
|
|
|
Hi DoctorMick
The List<MyBase>is tring to get me to do the following List<MyBase<string>> or List<MyBase<int>> however I would like both to be in the List
Thanks James
|
|
|
|