vb.net

Help setting focus on the parent

I have a simple situation (.NET2): a texbox1 on a UserControl1(or Form1). I want to unfocus(leave) the texbox when I click on the usercontrol/form(focus the usercontrol/form instead): I do the following on the UC/form: Protected Overrides Sub OnMouseClick _ (ByVal e As System.Windows.Forms.MouseEventArgs) MyB...

How to format the money using asian format

In India and other Asian countries money is formatted as following: The first three digits grouped in three then all other digits are grouped in pair of two. eg : 2,54,255.12 5,22,54,255.12 etc string money = String.Format("{0:#,##0.00}", 254255.12); gives the output 254,255.12 but the output required is 2,54,255.12 ...

Bind TCP server to specific adaptor

How can I specify which adaptor to begin listening on? I have an application running on a PC which happens to have 2 network adaptors running on different subnets (one network for Business LAN infrastructure, one for TCP cameras) I have a class which opens up a TCP server and listens on a specific port for connections coming in from cl...

arraylist checks

I have an arraylist that contains urls in the form similar to : stackoverflow.com/questions/ask/hello stackoverflow.com/questions/ask stackoverflow.com/questions stackoverflow.com/ If I only wanted to keep the first one and remove the rest, how would I go about doing that since technically they are not duplicates. I thought of using ...

Strange increase in email size using SMTP class to send an email as opposed to outlook

I am sending an email with an attachment using the following Code Dim msg As New System.Net.Mail.MailMessage(req.EmailFrom, req.EmailTo) Dim att As New System.Net.Mail.Attachment("C:\Documents and Settings\michaelr\Desktop\1216259.pdf") With msg .Attachments.Add(att) .Body = req.Em...

How to switch off the Procedure Seperator in VB.Net VS2008?

Apologies for the dumb question but it's driving me insane. How to switch off the annoying (to me anyway) horizontal line that seperates procedures in Vb? I've setup a new Dev machine for myself and for the life of me I can't figure out how to switch it off in VS2008. My mind is obviously failing with age, I know I did it on the old ma...

C++ undeclared identifier - object from .net dll class

I have a vb.net dll which I imported in an unmanaged c++ project. I successfully created an object of the class object using: CComPtr< IWSconnection > pIWSconnection; pIWSconnection.CoCreateInstance( __uuidof(IWSconnection ) ); Then, when I tried to call a method from the dll: pIWSconnection.connect(...); I am getting an erro...

Can I get an integer value from a list box populate with DataRowView?

Is there a way to get an integer value from a DataRowView? I have a list box with datasource set to a binding source. I would like to be able to do this: dim num as integer num = lstBox.SelectedValue But I receive an InvalidCastException: Conversion from type 'DataRowView' to type 'Integer' is not valid. This is how I fill my ...

Using vb.net dll in c++ - class is abstract

I created a vb.net dll which I am using in an unmanaged c++ project. When I try to create an object of the class, I am getting an error: cannot instantiate abstract class Why would my class be abstract? How can I modify it so that it won't be abstract? ...

Problems with AJAX control

I'm new to AJAX, and i've just received a project to improve full of this issue. I've studied AJAX briefly, then i know all the consepts and some simple features. and i also know that while developins, it's extremely different from the deployed general look. In the middle of one of the screens, there's this: I'm new to the project as w...

convert a single into 8 bytes invb.net

I have a single that might have a decimal place but might not. I have to put the digit before the decimal into the first 4 bytes and the digit after in the next 4 bytes. So 1.1 would be 01-00-00-00-01-00-00-00 or 2.1 would be 02-00-00-00-01-00-00-00 or 1 would be 01-00-00-00-00-00-00-00 The digit before the decimal point is stored like ...

.NET Web Service Root Namespace

I'm trying to set up a .NET 3.5 web service project in Visual Studio. My goal is to include a namespace in this web service that I can expose to web applications that references this web service. As you can see below, I have added the namespace "MyWebservices", but I am not able to find it after referencing the web service. Service1.a...

directcast in vb.net

i have 1 a.master page and 1 b.aspx with its b.aspx.vb page. I have the following property in the a.master.vb Public Property Page_Title() As String Get Return title_div.InnerHtml End Get Set(ByVal value As String) title_div.InnerHtml = value End Set End Property in the b.aspx.vb page i have DirectCast...

How to create a dynamic number of threads?

Currently I create a thread the following way (the normal way) Public loginThread As Thread Public loginThreadStart As New ThreadStart(AddressOf LogIntoWhatever) Public callLoggedIn As New MethodInvoker(AddressOf loggedIn) However, what I want to be able to do is something along the lines of (this obviously does not work, and is entir...

Find exact ASP.NET Type of page from inside a Master page

I'm trying to retrieve a custom Attribute set on a page's class from inside the MasterPage. Normally to do this I would need to reflect directly on the specific class, but inside the Master page it's always referred to as the Page type (the parent class). How do I determine the specific type of the Page property? Here's an example of w...

vb.net compile error 'abc' is ambiguous in the namespace 'xyz'.

I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of: Imyinterface is ambiguous in the namespace anamespaceassembly. I have tried with no success: examined the refere...

How Can I generate a static url a file in asp.net

I would like to generate a static URL based on a few parameters. The page serve the file for downloading is called CertificateDownload.aspx ,I am generating the download link in Report.aspx.These 2 files reside on the same physical folder.I do not like the replace method ,but I could not think of another way of doing it. How can I improv...

ASP.NET - C# vs VB.NET - Indirect differences and things you might not initially consider

I'm not interested in starting another "who has the bigger member" VB vs C# debate (http://stackoverflow.com/questions/158229/what-are-the-pros-of-vb-net seems to cover that already) though I am interested in indirect differences which may influence developing in one vs the other. All my commercial .NET development was desktop apps in VB...

Instantiate Local Variable By Value?

I sort of understand why this is happening, but not entirely. I have a base class with a Shared (Static) variable, declared like so: Public Shared myVar As New MyObject(arg1, arg2) In a method of a derived class, I set a local variable like so: Dim myLocalVar As MyObject = myVar Now when I do something like myLocalVar.Property1 += ...

overloads in vb.net

what exactly overloads signifies in vb.net coz even if i am not writing the overloads in derived class function its working in the similar manner when i am writing it. ...