vb.net

How to read Excel cell from VB.Net

How can I read specific cell from Excel file using OLEDB Connection with VB.NET? Can you show me sample code? Thanks in advance! Best reagrds, thlaing ...

Cannot add an entity that already exists. (LINQ to SQL)

Hello guys, in my database there are 3 tables CustomerType CusID EventType EventTypeID CustomerEventType CusID EventTypeID Dim db = new CustomerEventDataContext Dim newEvent = new EventType newEvent.EventTypeID = txtEventID.text db.EventType.InsertOnSubmit(newEvent) db.SubmitChanges() 'To select the last ID of event' Dim lastE...

How to convert ms access data into pdf in vb.net

I want to convert the ms access data into a document so that the print function in vb.net will read it. Where do I start from here? Here is my form: http://screencast.com/t/MGU4N2UyNmY And here is the code for print preview. Try PrintPreviewDialog1.ShowDialog() Catch es As Exception MessageBox.Show(e...

ASP.Net event only being raised every other time?

I have an ASP.Net web user control which represents a single entry in a list. To allow users to reorder the items, each item has buttons to move the item up or down the list. Clicking on one of these raises an event to the parent page, which then shuffles the items in the placeholder control. Code fragments from the list entry: Public ...

Generic WithEvents

Error: 'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints Background: Public Class Tadpole(Of T As IVisibleChanged, P As IVisibleChanged) Private WithEvents _Tad As T ' ERROR ' Private WithEvents _Pole As P ' ERROR ' Public Property Tad() As T ... Public Propert...

DataGridView does not show all rows at first (.NET 3.5/VB 2008)

I fill the DGV by looping through a dataset and adding a DGV row for each datarow. After this the DGV.RowCount = DataSet.Rows.Count. Funny thing is that the DGV shows only a part of it (19 of 2448 in my example). After some testing I figured out that the rows show up if I change the Window size a bit. So now I use a work-around by inclu...

Does the VB.NET "If" operator cause boxing?

Those of us who've worked in VB/VB.NET have seen code similar to this abomination: Dim name As String = IIf(obj Is Nothing, "", obj.Name) I say "abomination" for three simple reasons: IIf is a function, all of whose parameters are evaluated; hence if obj is nothing in the above call then a NullReferenceException will be thrown. This...

Distributing VB.NET App...What is causing System.DllNotFoundException

I've successfully built and tested a vb.net app in VS 2008 that uses a dll (abcTest.dll) built by another developer. However, when I deploy the application to another machine (Release directory contents), I get "System.DllNotFoundException" when I run the executable. The dll is in the same directory as the executable, etc. The solutio...

do postback programatically from iframe to parent page

I have a aspx page, in that page i have an Iframe. In the Iframe i do some stuff in code behind and when it is done I would like to do a postback from the aspx. In other words, Is it possible to do a postback programatically from the code behind of the iframe to the parent page? I think a postback can be done using "ClientScript.GetPo...

MySQL DataCOnnection and ADO.NET

I want to use mysqlconnection, command and datareader or sqlconnection, command and datareader based on a condition. I want to use same variables for both type of connection Ex: Currently i have dim _c as New mySqlConnection() dim _cmd as New mysqlCommand() dim _reader as New mysqlreader() _reader = _cmd.executereader() 'loop through ...

insert and display image in vb.net from sql server database

i need to upload and display images to and from database. i have written this code for uploading and it uploads fine. except 1 problem. It crashes when i dont select an image. can someone help me fix it for null value? also how do you display an image in IE? code for inserting image - Dim imageInfo As FileInfo = Nothing Dim data() As B...

What is the VB.NET equivalent to this C# code?

VB.NET equivalent to this C# code? ctx.Load(site, x => x.Lists.Where(l => l.Title != null)); I've tried ctx.Load(site, Function(x) x.Lists.Where(Function(l) l.Title IsNot Nothing)) but this errors with "The expression (Convert(l.Title) != null) is not supported." Thoughts ...

Refresh combo box in Windows Form

HI, This question has been asked a lot on the web but all of them seems to be confused with windows forms and asp.net forms so I had to finally come here for answer. I have a Main form (a window form) in VB.NET which has a Combo Box to display a list of countries. A sub form activated from a "Button" on the Main form allows users to ...

Two queries depending on each other while populating a table

I have 2 queries. One is populating a dataset that populates the dropdownlist and the other populates rest of the textboxes of a table row. i want to know how can i fill the entire dropdownlist and then make selectedvalue the value from the other query? e.g - dataset query = select hobby from hobbies other query - select name, dob, add...

controlling one player with other in vb.net

if i have two media players in form1 and form2 respectively....how can i control the media player in form2 with media player in form1....so that if i pause media player in form1...the media player in form2 should get passed and if i scrub the seek bar in player1 the seek bar in player in form2 should move along with it...how can i do tha...

Workaround for returning IDictionary-like collections from webmethod?

Problem is very well known - you can't return collection from web method that implements IDictionary. I'm not looking for a way to serialize IDictionary in xml. How do you work around this in .net 2.0? I need to return a collection from web method that looks like: Key, String value Key, String value Key, DataTable value So I would n...

transparency in swf in vb.net

how can i control swf background transparency in vb.net.........either with flash.ocx or if there is any other way.......so that if i have a swf animation block with red in background and some text written with yellow.......now how can i remove that red background in vb.net...actually i want to make a system so that i can choose any colo...

lambda expressions in VB.NET... what am I doing wrong???

when I run this C# code, no problems... but when I translate it into VB.NET it compiles but blows due to 'CompareString' member not being allowed in the expression... I feel like I'm missing something key here... private void PrintButton_Click(object sender, EventArgs e) { if (ListsListBox.SelectedIndex > -1) { //Context using ...

Effectively disable Sort() within a CompareTo() override?

The CompareTo() method for my class is dynamic, and can range from a simple comparison to comparisons on a number of columns. This is all determined at run time, and it works great. But in some cases, I want any attempt to sort a collection of my objects using the default comparison to just do nothing. Having CompareTo() just return a ...

display/retrieve image from sql database in vb.net

should be pretty simple for a pro. i have images in sql server database and i want to retrieve them in my aspx (vb.net) file. i have in aspx this image control - in vb.net i have started this code - Private Sub ImageDisplay() Dim SqlCnn As SqlConnection = Nothing, sql As String = "" ConnectDB(SqlCnn) Try sql = "SELE...