|
It's not the object that is changed to null, it's the reference.
The reference and the object are separate entities. Changing the object doesn't change the reference, and chancing the reference doesn't change the object. If you have a reference that points to an object and sets the reference to null, that doesn't change the object, it only makes it inaccessible through that specific reference.
Similarly, two references pointing to the same object are three separate entities. Changing the object doesn't change either reference, and changing one reference doesn't change the object or the other reference. Setting one of the references to null doesn't change the object and doesn't change the other reference.
---
single minded; short sighted; long gone;
|
|
|
|
|
I am trying to set the global value into into combobox and the value is not showing up in the combobox. Need help. Here is the code.
sql1 = @"SELECT locationNo, cast(locationNo as varchar) + cast(' - ' as varchar) + cast(locationName as varchar) as locationNames FROM Locations WHERE LocationNo = '" + VehicleGlobal.gv_Location + "'";
SqlDataAdapter da1 = new SqlDataAdapter(sql1, conString);
da1.Fill(ds, "Locations");
DataTable dt = ds.Tables["Locations"];
foreach (DataRow row in dt.Rows)
{
VehicleGlobal.gv_LocationName = row["LocationNames"].ToString();
}
this.cboLocation.Text = VehicleGlobal.gv_LocationName
|
|
|
|
|
try changing this
this.cboLocation.Text = VehicleGlobal.gv_LocationName
to
this.cboLocation.Datasource = VehicleGlobal.gv_LocationName
this may not work, it depends what type your VehicleGlobal.gv_LocationName property is.
|
|
|
|
|
hi,
I want to validate the onecolumn in datagridview like only digits entry.
By using keydown/keypress event how can i validate it for a perticular
column in Dtagridview.
Help me please
With Regards
prasad
|
|
|
|
|
|
try below line
if(Dtatgrid1.cells[row][col].value==?)
|
|
|
|
|
hi all,
I have set the password char for a textbox as *. and i am able to mask the password. I have a check box which prompts for showing the password.
Now how can i unmask the password char so that the password is visible in the textbox?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
You can change the textmode property of the textbox to single line again!
TextBox1.TextMode="SingleLine"
Gautham
|
|
|
|
|
hi gautham,
Thanks for the immediate response. I am using windows application in C#.
There is no textmode property for textbox control in windows application.
How to proceed?
Thanks once again.
Regards
Anuradha
|
|
|
|
|
Do the following
textBox1.PasswordChar = '\0';
|
|
|
|
|
hi,
Thanks for your help.I got it working.
Set the password char to \0 made to unmask my password.
Thanks for the help.
Regards
Anuradha
|
|
|
|
|
TextBox.PasswordChar Property
The character used to mask characters entered in a single-line TextBox control.
Set the value of this property to 0 (character value) if you do not want the control to mask characters as they are typed.
Equals 0 (character value) by default.
Gautham
|
|
|
|
|
Its just a trick...
1) Have a 2 textboxes which stores the password, one is masked and other unmasked at the same location having the same top,left,height and width.
At an instance depending upon the checkbox value, only one textbox is visible
if(checkbox checked true)
{
textboxMasked.Visibility = false;
textboxUnmasked.Visibility = true;
textboxUnMasked.Text = textboxMasked.Text
}
else
{
textboxMasked.Visibility = true;
textboxUnmasked.Visibility = false;
textboxMasked.Text = textboxunMasked.Text
}
In the check box unchecked event,do the above
Hope this solve ur issue...
please reply back if it solved ur requirement
N.Navaneethan
|
|
|
|
|
I need to do some math that involves truncating the number after the tenths place. So, I need to take some calculation and remove all digits after the first decimal place without rounding.
For example
3765/3700 * 100=101.75675675675675675675675675676
But, I need to produce from that calculation 101.7. Not 101.8 (the rounded form). Is there a built in method that performs this sort of calculation, or some other way that you might suggest? Thanks.
|
|
|
|
|
try math.ceiling or math.floor methods
Gautham
|
|
|
|
|
Hello,
If you want to show it as a string, you could use the String.Format method.
int numberofdecpoints= 10;
double d = 3765/3700 * 100;
string roundednumber = String.Format("{0:F"+ numberofdecpoints.ToString() +"}",d);
All the best,
Martin
|
|
|
|
|
May not be the prettiest
double d = 101.75675675675675675675675675676;<br />
string s = string.Format("{0:f2}", d);<br />
d = Convert.ToDouble(s.Remove(s.Length-1));
Using the specifier {0:f1} still rounds the number to 101.8, so use 0:f2 and truncate it.
only two letters away from being an asset
|
|
|
|
|
Can't you just do this?
<br />
double d = 128.158676;<br />
Convert.ToDouble(Convert.ToInt32(d * 10)) / 10;<br />
|
|
|
|
|
double d = 101.75675675675675675675675675676;
d = Math.Floor(10 * d) / 10;
Now d has a value of 101.7
Hope this helps
|
|
|
|
|
Help!
I need to convert bmp to pcx file? Does anyone have an idea?
Have problem using CXImageAtl.dll
Nataliya
|
|
|
|
|
hi everyone
i'm working with VS 2003 and can't find the create Class Diagram option.
can anyone please tell me how to make class diagram through VS 2003.
thanks for your time.
|
|
|
|
|
Saira Tanwir wrote: i'm working with VS 2003 and can't find the create Class Diagram option.
can anyone please tell me how to make class diagram through VS 2003.
There isn't one. It is a new feature of Visual Studio 2005.
|
|
|
|
|
For VS2003, you will need to use an external application such as Visio. The class designer was added in VS2005.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Class Diagram option is not available in Vs2003.
It is a new feature which is available in VS2005 only.
Regards,
Satips.
|
|
|
|
|
How many people does it take to say this? Both Pete and I already mentioned this. Pete also added a possible alternative which gave some new and potentially useful information.
|
|
|
|