vb.net

How do you incorporate "/x" option parameters into a .NET console application?

A lot of command line utilities use parameters, such as: gacutil /i MyDLL.dll or regasm /tlb:MyDll.tlb MyDll.dll How do I set up a .NET console application to take in command line arguments and, secondarily, how can you emulate handling "option" parameters like /i and /tlb: in the respective examples above? ...

Having a Pretty-Printed XML file from the WriteXml of a Dataset in VB.NET

Hello all, I'm trying to use Dataset.WriteXml() function in VB.Net to generate an XML file with Pretty-Print Layout (I think this is how it's named) like the example below (Listing 1): <MainRoot> <Table1> <Col1>Value1</Col1> <Col2>Value2</Col2> <Col3></Col3> <Col4>Value4</Col4> </Table1> <Table2> ...

How can I modify strings using a "For Each" loop?

'Why doesn't this work? Dim myStrings As String() = New String() {string1, string2, string3,} For Each s As String In myStrings If String.IsNullOrEmpty(s) Then s = "" End If s = "-" & s.Trim() & "-" Next If string1 contains "foo", my intention is that string1 contains "-foo-" aft...

change data in textbox using text changed attribute in vb.net

I've tried loading a mysql data into vb.net data grid view and it is dynamic. Dynamic meaning, it changes its contents whenever I type different text in the textbox. How do I do it in a textbox. When I load data into it. I just need to change its contents whenever I try to type a different word on the textbox which I use to search: Here...

Regex.IsMatch, is applied on "byte level" or "string level"?

I would like to know if the result of RegEx.IsMatch is affected by encoding. I am checking if a string is contained within another one by using a regular expression pattern. I am 99.9 % sure the pattern is correct, so my question is... The matching test with the Regex.IsMatch, is applied on "byte level" or "string level"? UPDATE: ...

How to fill Dictionary(Of TKey, TValue) directly in VB.NET

is there any way to do the same in VB.NET? Dictionary<int, string> myDict = new Dictionary<int, string>() { { 2, "This" }, { 1, "is" }, { 5, "radio" }, { 12, "clash" }, }; ...

Having a Pretty-Printed XML file from the WriteXml of a Dataset in VB.NET

Hello all, I'm trying to use Dataset.WriteXml() function in VB.Net to generate an XML file with Pretty-Print Layout (I think this is how it's named) like the example below (Listing 1): <MainRoot> <Table1> <Col1>Value1</Col1> <Col2>Value2</Col2> <Col3></Col3> <Col4>Value4</Col4> </Table1> <Table2> ...

get the id of a new record in SavingChanges event on the entityframework

Hi, Im tring to implement some generic logging in the entityframework 4.0 using the SavingChanges event in the entity context. I want to record details about any create/ update and deleted records including the id of the record being changed (which is always an int identity field). During the update and delete processes I can get the ...

Gridview doesn't update insert/update commands

I have a gridview that is set to a sql datasource, it is generating the columns automatically. If I add a column to the table it is referencing, it will draw that column and display it, but it does not update the insert/update commands to include the new column. Is there any way have it rebuild those commands automatically? ...

How do i pass whole ListView row and use it in external function?

ASP.NET application, VB or C# doesn't matter. I have Listview which databound to Dataset with about 20 items per row. I have a function which executes on each ItemTemplate appearance and gets about 10 params from Eval("something"). So basically one function builds and image from 10 parameters. Instead of passing 10 Eval("something") to ...

Is there an application that can manipulate images for ASP.NET ?

Basically functionality i need is: easy integration with ASP.NET application. user ability to crop image with handle prior to save image optimization from any image type to jpg (compression levels) during the save saving images with proper h/w ratios during the save user ability to rotate the image prior to save ability to translate ap...

ASP.NET How do I wait for file upload/release?

Hi, I've got ASP.NET intranet application written in VB. It gets a file from the user, and then depending on a few different cases it may create a few copies of the file as well as move the original. Unfortunately I've come across a case where I get this error: Exception Details: System.IO.IOException: The process cannot access the f...

adding characters into a datagrid in vb.net

im new to vb.net and am a lil lost ...:(.. i wud like to knw hw i could i/p a string via textbox and display its individual characters into a datagrid view in diff rows... Please help... ...

ASP.Net dropdownlist within a detailsview not being set in codebehind

I have the following code in my codebehind Page_Load function that sets the default selected value of a dropdownlist in detailsview based on the name of a record returned from a sql data query. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.Page.Title = "Editing record" '...

My Devexpress Gridview Delete event is firing multiple times

I have a Devexpress Gridview that is linked to a delete, fetch and update stored procedure. The problem I am having is that when I run my program, select a row in the grid and press delete it fires the event multiple times. Specifically it deletes the selected row and then I re-fetch the data so the focus returns to the first row. Which ...

Download a file From https using VB.net

Could anyone help me please ? I need to download a file from web i.e https:\www.xxx.com\ using vb.net and save it to C drive of system. Below is the code : Dim URI As String = ftpHost & ftpFile Dim oRequest As System.Net.HttpWebRequest = CType(HttpWebRequest.Create(URI), HttpWebRequest) oRequest.Credentials = New System.Net.NetworkCre...

How to deal with inserting values into two tables when exception occurs.

Hi, I have 2 tables loginInfo and UserInfo. LoginInfo Stores username and passwords while userinfo stores other user details such as Address,postalcode,phone etc. I insert values into loginInfo first and if successful I enter the userInfo details. If exception occurs while entering details into userInfo i delete the loginInfo details....

How can I retrieve a DataGridView from the clipboard? (It ends up being Null in clipboard).

I am unable to read a pasted datagridviewrow object from the clipboard. All I want to do is, when a user has the entire row selected and copied, I would paste that row into the clipboard as a DataObject. That works just fine but when I attempt to read that DataObject (after the user clicks Paste) the DataGridViewRow that's saved in the c...

Is there any way to get IsDate(Date) to come back as false?

I'm reviewing some code in VB.net, and in a validation object they have written the following If Not IsDate(Entity.SelectedDate) Then ErrorList.Add(New CValidationError("MainReport", "Please select a weekend date")) SelectedDate is of type Date. It seems to me it would be impossible to ever hit this condition. Is this tru...

Problem with clipboard class.

Hi, I have created a application which checks if the text in clipboard starts with "file", and if it starts with the word file it process the clipboard text and then replaces it with < a href="some value"> For example it the clipboard string is file:///C:/Users/Searock/Desktop/dotnet/Apress.Pro.VB.2008.and.the.dot.NET.3.5.Platform...