|
Hello,
I think you need the Refresh() method.
The painting will be done emidiately!
Invalidate marks it just for the next painting.
Hope it helps!
All the best,
Martin
|
|
|
|
|
hi all
i know that string is refrence type
now
string s="Shetty";
string s1=s;
s="Pinky";
msb.show(s);
gives shetty as the answer right...
my assumption is
since string is reference type the address is stored in s1 when the value changes in that address new value should come right
please clear me
|
|
|
|
|
Hello,
kalyan_2416 wrote: s="Pinky";
msb.show(s);
gives shetty as the answer right...
No, "Pinky" will be shown!
s1, would show "Shetty"!
kalyan_2416 wrote: since string is reference type the address is stored in s1 when the value changes in that address new value should come right
No, reference type is not the same as pointers in C++.
In your code example, s just gets a new address, but s1 will not change as it's address stays the same.
Hope it helps!
All the best,
Martin
|
|
|
|
|
A string is a reference type, but a string is also immutable. You can never change the value of a string, you can only change the reference that points to a string.
If you assign a new string value to a string variable (a string reference), you just replace the value of the reference to point to the new string object, you never change the actual value in the string object.
The string objects for string literals are created when the program loads, not when the value is used. Therefore your code will actually work more like this:
const string str001 = "Shetty";
const string str002 = "Pinky";
string s, s1;
s = str001;
s1 = s;
s = str002;
msb.show(s);
So you see that in your code you actually don't create any string objects or change any string values, you only assign some references to objects that already exist.
---
single minded; short sighted; long gone;
|
|
|
|
|
i have installed sql server reporting service 2005
1. how i can get the list of reports (*.rdl) in a windows application c# 2005
( sth like Server.GetReportNames ???)
2. how i can get the list of each report parameters in a windows application c# 2005
( sth like Server.GetParameters ???)
|
|
|
|
|
Hi
somebody explain me the concept of reflection, and when we need that, and to use that.
|
|
|
|
|
|
Refelction is the mechanism of discovering class information solely at run time.Wondering where it would be useful? Imagine,you are in visual studio IDE (Integrated devolopment environment) and as you type "object." you would see all the methods,properties and events associated with that object.
Reflection[^]
Regards,
Satips.
|
|
|
|
|
I have a report that displays the percent of true or false answered for questions.
I am using pie chart to display the result.
In case either of the value is 0, no label is displayed saying 0% on the chart
Is there any way to display it?
|
|
|
|
|
i want to select the menuitem from a menu
|
|
|
|
|
So, where is the problem? Add a menu to your forms and add Menu Items and finally implement the event handlers for the Menu.
Manoj
Never Gives up
|
|
|
|
|
Hi
I am trying to upload file using Http Post, I need to set content type-multipart.Please advise..
I tried many ways but not succesful..
Thanks
|
|
|
|
|
Is this in a browser scenario, or is this in a desktop scenario? With ASP.NET, the best way to upload a file is with the FileUpload control. In a desktop situation, use WebRequest.Create() to create a web request. Set the ContentType property on the request, and then get a response for it:
WebRequest request= WebRequest.Create(url);
request.ContentType="multipart/form-data";
request.Method="POST";
Stream stream=request.GetRequestStream();
WebResponse response= request.GetResponse();
--Justin
Microsoft MVP, C#
|
|
|
|
|
My requirement is, i added 50 empty rows to the Data grid. One of the columns of the datagrid is of ComboBoxColumnStyle. Now after filling data into just two rows (remember i have 50 empty rows), when i click on column header of ComboBoxColumnStyle columns it is sorting the total 50 rows, but i want to ignore the empty rows (other 48 rows). Because if i don't ignore the empty rows and sort the rows with data are being moved to end of the grid, leaving all above rows empty.
Any ideas, how to sort rows only with data?
Thanks
kumar
|
|
|
|
|
Hi,
You can set the "SortMode" properties for the column as "Programatic". In this case you can control the time when you want the sorting to take place.
Manoj
Never Gives up
|
|
|
|
|
its simple write one for loop for geeting all the data from datagrid and check within for loop the data is available or not .if the data is available sort the data.
|
|
|
|
|
In which event should i write this code?
|
|
|
|
|
Hi,
I declare a HashTable as a class variable, and assign values to it inside a private fuction. I try to access the HashTable in another function, but the order of the Keys added is lost.
If I have added keys in the order 1, 2 and 3 (with its Value), when I access the HashTable the order is lost, it may be in 2-3-1 order or some other order.
Usually hashtable retains the order, could anyone point what going wrong here.
Regards,
Blumen
|
|
|
|
|
Hello,
No Hashtable is not holding the order.
An ArrayList does.
All the best,
Martin
|
|
|
|
|
|
you can use sorted list, if you want that in an order
My small attempt...
|
|
|
|
|
Hashtable never orders the keys. You can NEVER rely on that. Use a SortedList instead.
|
|
|
|
|
hi,
i hava following error :
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.]
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +483
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +424
System.Web.UI.Page.LoadAllState() +559
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2237
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
can any body tell the solution
|
|
|
|
|
You need to reset the page's viewstate after adding the controls dynamically, then it will recreate it, and all should be fine.
|
|
|
|
|
I'm trying to make a call into a compression dll
This is declared like this in VB6:
<br />
Private Declare Function compress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long<br />
Private Declare Function uncompress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long
I've added the following to a c# class
<br />
[DllImport("compression.dll")]<br />
public static extern int uncompress(ref byte[] inputBuffer, ref int inputLength, ref byte[] outputBuffer, int OutputLength);<br />
[DllImport("compression.dll")]<br />
public static extern int compress( [MarshalAs(UnmanagedType.LPStr)] StringBuilder inputBuffer,ref int inputLength, [MarshalAs(UnmanagedType.LPStr)] StringBuilder outputBuffer, int OutputLength);
If i call the compress method using c# and decompress using c# this works fine. The problem arises when i try to compress in c# and decompress in vb6 or vice versa. Is there a back compatability mode for string functions like this?
Thanks in advance
Russell
|
|
|
|