Hi,
I'm working on a vb.net application which imports from an Excel spreadsheet.
If rdr.HasRows Then
Do While rdr.Read()
If rdr.GetValue(0).Equals(System.DBNull.Value) Then
Return Nothing
Else
Return rdr.GetValue(0)
End If
Loop
Else
I was using st...
Is there anyway I can build a Select statement that uses the Contains function? Like this:
Select commentStr
Case commentStr.Contains("10")
Case commentStr.Contains("15")
...
I read in a Byte Array generated from a function called from an external DLL file and then converted (encoded) it into a String. In the Locals window (shown below), msg does not have a trailing double-quote.
Is this a bug, glitch, or a sign something is wrong?
Code:
Dim msgC(32) As Byte
Dim msg As String, length As Integer = ...
I'm adding a ToolTip to a ListViewItem. However, the ToolTip only shows up when the user hovers over the first cell in the row to which the ToolTip has been applied.
MyListViewItem.ToolTipText = "Important Message"
The only other code I have related to ToolTips is this:
MyListView.ShowItemToolTips = True
Any idea how I can make th...
I have a very simple .net application for testing SMTP on .net. But i am receiving this weird error.
"System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused i...
I've inherited a Visual Studio/VB.Net numerical simulation project that has a likely inefficient calculation. Profiling indicates that the function is called a lot (1 million times plus) and spends about 50% of the overall calculation within this function. Here is the problematic portion
Result = (A * (E ^ C)) / (D ^ C * B) (where A-C...
I have a MustInherit Parent class with two Child classes which Inherit from the Parent.
How can I use (or Cast) Me in a Parent function as the the child type of that instance?
EDIT: My actual goal is to be able to serialize (BinaryFormatter.Serialize(Stream, Object)) either of my child classes. However, "repeating the code" in each ch...
I'm not entirely sure what to call what C# does, so I haven't had any luck searching for the VB.Net equivalent syntax (if it exists, which I suspect it probably doesn't).
In c#, you can do this:
public void DoSomething() {
new MyHelper().DoIt(); // works just fine
}
But as far as I can tell, in VB.Net, you must assign the helper ...
i have 1 master page with 5 dropdownlists on it. The thing is, the master page has href's to aspx pages that use this master page as pagebehind. now lets save i am in page1.aspx with master1.master as pagebehind. If i select couple of dropdownlists, and then click on an href, the whole master page reloads. how do i catch this in session ...
Hi,
I have some trouble with loading a richtextbox from a memorystream.
I have some data in a database table stored as a byte array, I convert it to a string and load it into a memorystream and then I want to load that memory stream in the richtextbox. The application breaks on
Dim tr As New TextRange(rtbTemplate.Document.ContentSta...
In a CD collection program, I have each artist's country of origin stored in the main database and want to display a map of the world which:
Colour-codes each country depending on the number of CDs by artists in that country
Allows clicking on each country to filter a list of CDs to only ones by artists in that country
This is a heav...
I tried to get os version of remote computer using ip address with WMI ,It shows "RPC server unavailable" error.
If anybody have solution for getting remote system information without WMI in vbnet,
Please help me
...
How can I resize the two dimensional array size without affecting its value?
...
Hello,
When you use a tab key to select a textbox, all text in it is automatically selected. What's the easiest way to prevent this from happening? (Setting the selection to none in Enter or GotFocus events doesn't work)
Thanks (-:
...
So, I've changed my settings in Tools | Options | Text Editor, for All Languages, Basic, and C#, to having Block indenting, and 'Keep tabs'. I've also tried this with Smart indenting too. Now, although once I start editing a file, its auto indentation is done with tabs, when I create a new web form in my ASP.net website, VS2008 insists...
I am settting up control propertis on page load.
Like visiblilty of control depending on loaded data. And very simple setting up images to button controls.
For page load it works fine but on postback these values are not set back.
This is my code. When it’s a postback btnSecurityQA image is missing and visibility of all following control...
I had until recently been under the impression that the CDbl(x) operation in VB.NET was essentially a cast (i.e., the VB equivalent of (double)x in C#); but a recent discovery has revealed that this is not the case.
If I have this string:
Dim s As String = "12345.12345-"
And I do this:
Dim d As Double = CDbl(s)
d will be set to th...
Hi, I click on items in my listbox and then hit a submit button, but when istep through my button_clicked code it doesn't detect any selectedindex. All controls are in the same form and there are no panels. Why can't I detect what items were clicked on in the listbox? Thanks!
...
What is the impact of creating variables using:
Dim ds as New DataSet
ds = GetActualData()
where GetActualData() also creates a New DataSet and returns it?
Does the original empty DataSet that was 'New'ed just get left in the Heap?
What if this kind of code was in many places? Would that affect the ASP.NET process and cause...
Hi folks,
I have a date column in a DB tabel that I want to query using a date taken from textbox.text. the user selects a date from the calendar in the format dd/MM/yyyy. I want to use that date to put into a query. How do i format the date to be able to query the database?
Dim datefrom As String =txtDateFrom.Text
Dim dateto As St...