many times i was not getting correct output,then i put .tostring() at the end then it gave good output.so basically why do v need this?also Convert.ToInt32(cmd.ExecuteScalar()) why convert to int32?
View Complete Post
I've come across an argument that, whether int.ToString() method cause Boxing in following case:
int varInt = 123;
string varStr = varInt.ToString();
Please give some light on this issue. Let me know the internal processing of INTEGER.ToString() function, if any of you knows.
in the codebehind I gave a line gives always zero eventhough textbox1
is not null or zero. I type a number but it return zero...when I try
Int32.Parse also it does not work and gives "Input string was not in a correct format." error.please help...
Hi. I'm new to Visual Studio 2008 and this is my first time using the forum. Could someone give me examples of how to use the ToString(), Copy()? I know how to use the "ToLower() which converts the current string to lower case. I would code: Dim str1 As String = "Hello World!"Dim str2 As String = str1.ToLower()Result: str2 contains "hello world!"I only need to have examples of how I would code the two methods mentioned above. Thanks you inadvance
When i use the toString() method on a lookup field i get a string in the form:
Is there a way (a command) to get only the name?
I have the following code to show a logging window that has the last 64000 chars of code. Every new line I add the first line will be deleted:
m_sbText = new StringBuilder(65000);
private void AddLine(string LogMessage)
if (m_sbText.Length > 64000)
m_sbText.Remove(0, m_sbText.ToString().IndexOf("\n") + 1);
textBoxLog.Text = m_sbText.ToString();
When I let this run the first time I got an OutOfMemory exception because I forgot to add
textBoxLog.UndoLimit = 0;
So this UndoLimit problem is still happening in WPF dot net framework 4.
I added the UndoLimit and let this run for a night. Once every few hours the textBoxLog.Text = m_sbText.ToString(); line raises a System.ArgumentOutOfRangeException Index was out of range exception on StringBuilder.ToString(). Because I do not do anything
with the Index I suspect the StringBuilder to mess up internal indexes.
Ive gotten this error to my underlined line(bold): Cannot convert method group 'ToString' to non-delegate type 'int'.
How do i Solve it??
protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
Label2.Visible = true;
SqlConnection conn = new SqlConnection("Data Source= EN12-2-20-PC02\\SQLEXPRESS;" + "Initial Catalog=ssms;Integrated Security=SSPI");
DataSet ds = null;
ds = new DataSet();
int timestamp = 0;
timestamp = GridView1.SelectedDataKey.Value.ToString;
SqlDataAdapter da = null;
string mySQL = null;
mySQL = "SELECT timestamp from loginHistory where username = '" + lblShowUser.Text + "'";
da = new SqlDataAdapter(mySQL, conn);
DataSet dsSel = new DataSet();
GridView1.DataSource = dsSel;
I am working with an object that handles localized strings. The object type (LocalizedString) provides the correct localized string in its ToString() method.
I have a view model that exposes a property of type LocalizedString. When my current thread and ui culture is changed, I raise the property changed event for this property, however the strings in the UI do not get updated.
I narrowed it down some to discover that it stops working after the value has been read from the property once. If instead of just raising property changed when the culture changes I do this:
LocalizedString temp = MyProperty;
MyProperty = null;
MyProperty = temp; // <-- property changed gets raised in the setter
It seems to work. The only difference is that the LocalizedString object instance changed.
Basically I believe what happens is this: The dependency property (TextBlock.Text in this case) gets notified that the bound value has changed. It goes and retrieves the property value (LocalizedString object),
does a comparison and sees that the previous value and the new value are the same object instance, and stops - does not refresh the