vb.net

How to Remove multiple records from Datatable in vb.net 2008 not from database in local table ?

I have datatable in vb.net 2008 has 40000 rows. i want to delete 1000 rows from that datatable not from database. i want to do this without looping I know remove and removeat but both need looping. is there any way i can achieve this thing ? ...

File System Watcher - Folder Deleted

I´m writing on an service to watch for the existence different files in diffent folders... I´m using filesystemwatchers to get the events. As a part of the deployment one of the watched folders is deleted and new created from time to time. As a result the service throws an error and is stopped... Is it possible to catch that kind of e...

How to do Custom Validation on Multiple Properties in ASP.NET MVC 2.0?

Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott gut...

Changing DataGridView Column Properties in VB Code

So I'm adding columns in the code, rather than design view... frmMain.dgv_test.Columns.Add("col1", "1") frmMain.dgv_test.Columns.Add("col2", "2") 'etc How do I edit properties such as Column Width, Frozen, and all the other properties that can be seen in the design view if I were to "design" a column? Thank you. ...

How to use value from primary accessdatasource control as parameter in select query for secondary accessdatasource control

Hi, I'm trying to display all orders placed and I have a primary accessdatasource control that has a select query to get the customer information and the orderID. I want to use the orderID value from this first query as a parameter for the secondary accessdatasource control that selects the product information of the products in the ord...

How to increase the size of a text box base on the text content.

I have a report that I need to increase the size of the textbox base on the length of the text. There some formula to calculate the resulting lenght size? ...

VB.NET LINQ to SQL Delete All Records

I am having problems with deleting all records in a table with VB.NET. I am using this code to delete all records in the Contacts table For Each contact In database.Contacts database.Contacts.DeleteOnSubmit(contact) Next But I get this error Can't perform Create, Update or Delete operations on 'Table...

Default Object being modified because of LINQ Query

I'm doing the following code to filter a list of objects before it gets sent off to be printed. Dim printList As New List(Of dispillPatient) For Each pat As dispillPatient In patList If (From meds In pat.Medication Select meds Where meds.Print = True).Count > 0 Then Dim patAdd As New dispillPatient ...

Refresh combo box in Windows Form VB.NET

Following is the code to populate combobox using DataSource Dim CountryList As Array = MyCtrl.GetAllCountries With cbCountyList .DataSource = CountryList .DisplayMember = "CountryName" .ValueMember = "CountryID" End With After adding a new COuntry Name to Database I want to reflect the changes in combobox. R...

VB.NET CInt(Long) behaving differently in 32- and 64-bit environments

Hello everybody, this is my first message here. Today I had a problem converting a Long (Int64) to an Integer (Int32). The problem is that my code was always working in 32-bit environments, but when I try THE SAME executable in a 64-bit computer it crashes with a System.OverflowException exception. I've prepared this test code in VS20...

Class/Model Level Validation (as opposed to Property Level)? (ASP.NET MVC 2.0)

Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott gut...

vb express / visual studio - is it possible to run / debug one form only in a multi form application?

hi, I have a vb application consisting of several winForms and code files. Is it possible to run / debug only one form without having to run the whole application? To be more specific, one of the forms in my application is the settings form where the user sets his/her desired options. These options are read/written to an xml file. Is i...

Most Frequent Number

Hello, I've used an array of strings to populate a DataGridView. How do I go about finding the most frequently occurring number? Or, even better, order them by most frequently occuring? Thank You. ...

[VB .NET] Table with 3 columns. How can I make the middle one autogrow?

hey there. This might sound a really simple issue but it's kind of driving me nuts. I have a table with 3 columns. The first column has some numbers in labels. The second column has a ListView, and the 3rd column has some small buttons. What I want is that when the user maximizes the window, the column that grows is the middle one and...

How to find when the media player has finished vb.net

EndOfStream event doesnt seem to be working. I put a msgbox in the event and it wont come up once the CurrentMedia has played. I need to track when the media player has finished playing a video. Someone help! ...

Oracle XE + ODP.NET ANNOYING VIEW ERROR

Sup guys, heres my view: CREATE OR REPLACE VIEW SISTEMA.VWTELA AS SELECT TEL_DLTELA AS Tela, TEL_DLDESCRICAO As Descricao, TEL_DLTABELA As Tabela, CASE WHEN to_char(TEL_STATIVO) = to_char(1) THEN to_char('Yes') ELSE to_char('No') END as Ativo, TEL_IDTELA AS IDTEL FROM SISTEMA.TEL_TELA; When i do a SELECT * FROM SISTEMA.VW...

Vb.net on running shows updation exception

I've a website in vb.net. While running the website i get the following error: "Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype." My DB connection.inc file looks as follows: <%@ Import namespace="ADODB" %> Dim strDataSource As String Dim cnnCRM As ADODB.Connectio...

Vb.Net action delegate problem?

Hi, Am vb.net newbie. This question might be very novice and answered before, but i couldn't find. I was trying the lambda features and got struck here. Private Function HigerOrderTest(highFunction as Func(Of Int16,Int16)) As Action(of String) Dim sam = highFunction(3) Dim DoIt as Action(of String) DoIt = sub(s) console.Wr...

Font serialization in vb.net

Hello all, as the title says , I need to serialize my font. I have tried the following approach unfortunately to no avail. This is what I have and what happens; I have a drawing application and certain variables and properties need to be serialized. (So , Xml.Serialization has been used.) Now this has already been done in a huge por...

C# To VB.Net Conversion - array of class objects with initialisation

can someone help me pls, im new to vb.net and im trying to work through the nhibernate firstsolution sample (written in c# re-posted here http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/01/your-first-nhibernate-based-application.aspx as thier site is down again) and im struggling to convert this one bit. ive tried numerous ...