vb.net

How do I update a single table of a DataSet using a TableAdapter, without hard-coding the table name?

This seems like a really basic thing that I'm doing, yet I'm tearing my hair out trying to make it work. My situation is this: I have a project which contains a large number of lookup tables, and I have all of these lookup tables represented in a single typed DataSet, which contains TableAdapters for each lookup. I've designed an edito...

Conditional XML Literal

I've tried searching on this but can't seem to find an answer anywhere, so hopefully someone here can help. I want to insert an conditional XML tag based on whether or not a count is above one, but am not sure how to do it. For example, I have two XElements that are like this: <Blob> <Group> Stuff 1 </Group> </Blob> and <Blob> <Gro...

What is the best practice for setting the SccAuxPath property in a Visual Basic .NET project for a distributed team?

We've recently moved to Team System and now a remote team needs access to our source. However, they use a different IP address to access the Team System server, and whenever they try to open a project, they are prompted to check out and change the project. Is there a way to work around this? It seems to be the 'SccAuxPath' property wh...

Refresh form during long synchronous operation

I am running several long synchronous operations in my VB.NET application that can take several minutes each to complete. During these operations the form will turn white and the title bar will show "Not Responding" and some users may close the application thinking it has stopped working when in fact it is still running. I am pretty su...

Why might dropdownlist.SelectedIndex = value fail?

I have a dropdown list that I am binding to a datatable. Here is the code I am using to do it: ddlBuildAddr.DataSource = buildings ddlBuildAddr.DataTextField = "buildingName" ddlBuildAddr.DataValueField = "buildingId" Dim addressId As Int32 = OfficeData.GetInstance().GetBuildingId(currentAddress) ddlBuildAddr.SelectedIndex = addressId ...

Microsoft .Net Chart Control not showing markers

Hello, I'm using the Microsoft Chart Controls for Microsoft .NET Framework 3.5 and am having a spot of trouble getting Data Markers to show on the image. I'm generating the chart at run-time, so can't just use the designer. Sub New() MainChart = New Chart MainChart.Size = New Drawing.Size(500, 200) MainArea = New ChartAre...

vb.net compare string values

How can i compare two string values in vb.net? i've tried compare, equals functions but it's not giving me the correct result. what i'm trying to compare is as follows. also let me know if the code is correct. i'm new to vb.net Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ...

Excel Autofilter in VB.NET

In my application I'm exporting an Excel file by getting the layout of a HTML page. So, in my codebehind, I'm modifying the HTML layout and inserting itens on it like if it was a webpage. Doing it that way, I don't need to use any external library and, as the data I'm exporting is just a table, I don't need nothing complex to handle it. ...

Vb.Net Datagridview Error Handling

I have a datagridview that seems to be working fine until the user adds a name into the unique name column that already exists. I am getting this: System.Data.ConstraintException: Column 'Name' is constrained to be unique. Value 'test' is already present. Any suggests as to where and how I capture this error and prevent the users fro...

Selecting a random button and modifying its text (VB.NET)

I am making a game of tic tac toe, and I have 9 buttons lined up in a grid pattern. I want to select a random button for the computer to start the game from. I have an array set up with all the names of my buttons, and I was thinking of picking a random entry from that array to start working from. This I have done fine, but I cannot cha...

percentage symbol to decimal numbers in .net

Using .net To add a $ symbol for numbers I did Texbox1.Text.Format = "C" How to add % symbol at the end of each integer to represent a string in textbox. ...

show percentage by specifying DefaultCellStyle.Format value in datagridviewcolum

With datagridview.Columns("PricePerUnit") .ValueType = Type.GetType("System.Decimal") .DefaultCellStyle.Format = "C" End With A datatable is bound to the datagridview and in the above code a If I just add row with a value five to the column "PricePerUnit" it will be shown as $5.00 in the datagridview column Similarly I want ...

center MessageBox in parent form

Is there a easy way to center MessageBox in parent form in .net 2.0 ...

Reusable Custom Control with Properties

I have built a Custom Control Class that makes it much easier to build a side bar element in my html. The problem I am running into is that when I set the "Text" property, the last time I set it gets used for every instance of the control on my page. This is my first time doing this, so I'm assuming I'm missing something basic. Namesp...

How to exclude an FxCop in source when item is auto-generated?

For example: Public Event CurrentChanged As EventHandler(Of CurrentChangedEventArgs(Of T)) Shows the message "Do not nest generic types in member signatures." on CurrentChangedEvent, which is the variable that holds the delegate for the event, and VB generates it automagically. How do I suppress the rule for the item? ...

Create Custom Control with reusable properties

This is similar to my last post but with a different purpose. I have built a custom control, but when I set the properties for it... ALL instances of that control on my page grab the exact same property. I need to be able to set the property to "abc" for one instance of the control on my page, and then set the exact same proprty to "xy...

Serializing a dataset to a strongly type business object property

In a vb .net winforms app I am trying out something for "wide and shallow" children of a record. I use strongly typed business objects ( Strataframe ). My plan is to have a number of "child tables" collected in a dataset I drop on the form. they have no correspondence in persisted data, so the dataset is untyped and I am creating th...

Search all dates before a specific date in a database (VB.NET|OLE)

Hello, I have a database (MDB, Access) and I connect it to my program using an OLE object, now I have in the db a column filled with dates (ddmmyy), I want to search and view (in Data grid view) all the fields that has a date before a Specific Date that I define . the code of search that I used is : SQLstr = "SELECT * FROM tb WHERE...

How can I able to get all the extensions in a Directory.?

Hi, How can I able to get all the extensions in a Directory. This is for vb.net windows application. Thanks, Babu Kumarasamy. ...

How can i calculate height of a website?

Hi, I want to take a snapshot of a website so i have to calculate height of a website. I want to use this value in: Dim MyBrowser As New WebBrowser MyBrowser.Size = New Size(1027, ???) Thanks... ...