vb.net

Connecting to a access datbase via a Account Name and password.

Hi, I'm trying to use to different methods of connecting to a database to edit data, the declaration below is working: Dim rsConn As ADODB.Connection rsConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & Application.StartupPath & "\VFMS_DB.mdb;" _ & "Jet OLEDB:System Database=Security.mdw", "Ads", "1234") but now I want t...

confusion over datagrid erasing entries and general datagrid access

Hello, I have a datagrid which I am using Linq to fill, I then add some custom columns and fill them in programmaticly - if the users clicks on the column header to re-sort, all the data in the added columns disapears. I am obviously missing something very basic here but can't seem to see the forest for the trees. I also have a couple...

DateGrid View - As and unBound control

Hi Trying to use a DataGridView like the old VB6 FlexGrid, and add the coloumns manually via addrow (built a Row containing TextCells) and my Coloums are all added (and display ok) but as soon as I try to add a row I get the message "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bou...

change datagrid columns order or index

OK, This is something that I cannot believe I have not been able to figure out -- please tell me I am missing someting simple... I have a datagrid, I am filling it with Linq as well as a custom class to add data to it. Afterwards, I need the data in a specific order - it seems to ignore me. How do I change a columns properties, like ...

.Net equivalent of the old vb left(string, length) function?

As a non .net programmer I'm looking for the .net equivalent of the old vb function left(string, length). It was lazy in that it worked for any length string. As expected, left("foobar", 3) = "foo" while, most helpfully, left("f", 3) = "f". In .net string.Substring(index, length) throws exceptions for everything out of range. In Java I ...

Convert StringCollection to List<String>

Normally, I'd choose List<String> [or, in VB, List(Of String)] over StringCollection whenever possible: see also Best string container. However, as it seems, generics — and hence, List<String> — are apparently not supported in VS 2008's settings designer. Therefore, if I want to use a list of strings in my user settings, I have to resor...

return only Digits 0-9 from a String

I need a regular expression that I can use in VBScript and .NET that will return only the numbers that are found in a string. For Example any of the following "strings" should return only 1231231234 123 123 1234 (123) 123-1234 123-123-1234 (123)123-1234 123.123.1234 123 123 1234 1 2 3 1 2 3 1 2 3 4 This will be used in an email pa...

Robust and friendly command line tools for .NET?

Forget fancy shmancy web stuff. I'm looking for a good .NET CLI argument processing utility, prefer open source code. This is for quick and dirty utilities that need robust and friendly command line argument handling. These are utilities with maybe a day of effort in them. Investing a few days writing good command line handling seems o...

How to write a vb.net code to compile and execute C programs?

I'm trying to make a vb.net application that has got 2 textboxes, 2 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C/C++ file into the 1st textbox and on clicking the compile button, i should be able to show the errors or the C/C++ program in the 2nd textbox. On clicking Run, I should ...

ASP.Net Grid View rolling total in Gridview

I have seen several tutorials on how to achieve this. However in my opinion they require a lot of prior knowledge on how to programatically refer to each item. Does anyone have a link to or can create a relatively basic example of how to achive a running total in the footer for an ASP:Gridview? ...

sqlite in vb.net, can't find table even though it exists

I'm using the following code (System.Data.SQLite within VB.net): Dim SQLconnect As New SQLite.SQLiteConnection() Dim SQLcommand As SQLiteCommand SQLconnect.ConnectionString = "Data Source=vault.db;" SQLconnect.Open() SQLcommand = SQLconnect.CreateCommand SQLcommand.CommandText = "INSERT IN...

How to create a windows registry watcher?

How to create a windows registry watcher application using .Net, I want this application to watch all the registry hocks and fire an event when a value change, this event will tell the old and new value for that value. Thats possible? how? need just the idea or where to start ...

Conditional Linq Queries in VB.NET

I'm triying to do exactly the same thing described here, but in VB.NET I tried all of the C# to VB converters but no one seems to work with LINQ. I'm totaly new to C#, so any help will be appreciated ! public static IQueryable<Type> HasID(this IQueryable<Type> query, long? id) { return id.HasValue ? query.Where(o => i.ID.Equals(id....

How to write a vb.net code to compile C/C++ programs?

I'm trying to make a vb.net application that has got 2 textboxes, 7 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C/C++(or any programming language) file into the 1st textbox and on clicking the compile button, i should be able to show the errors or the C/C++ program in the 2nd textbo...

.NET Check if another application is running

I have an application that provides core services for a series of other applications. When another of these applications is started, I want to check that the service application is running and if not shutdown. What is the best method to check for the existence of the other app? I'm thinking that I should be using a global mutex in the...

how to create windows applications in VB.Net or ASP.Net

which method is more efficient to use: DataAdapter and DataSet Or DataReader when importing data from a certain database table??? ...

Dim X as New Y vs. Dim X as Y = New Y()

Duplicate Whats the difference between declaring as new and as something new something i Sad that I don't know this, but can anyone explain the difference between: Dim X as New Y and Dim X as Y = New Y() ...

Auto resize columns based on char count

I am trying to figure the best way to programmatically re-size table column headers in ReportViewer. Basically, my current resolution is the following: ColumnWidth = HeaderCaption_CharacterCount * 0.32 Where 0.32 is an estimated width of a typical character using my current font size. The issue is that the width leaves a lot of white...

How do I cast from System.Web.HttpPostedFileBase to System.Web.HttpPostedFile?

While trying to implement an MVC file upload example on Scott Hanselman's blog. I ran into trouble with this example code: foreach (string file in Request.Files) { HttpPostedFile hpf = Request.Files[file] as HttpPostedFile; if (hpf.ContentLength == 0) continue; string savedFileName = Path.Combine( AppDomain.CurrentD...

Is it possible to update a binary field in SQL Server?

I know how to insert a new row into a table that has a binary column. But is there any way to update the binary column once that row has been added? So far an exhaustive google search has turned up nothing. MY solution so far is this Get the current row that I wish to update delete the row that I wish to update Create a new row with t...