vb.net

Type casting in VB .NET

I am adding a feature to an existing VB .Net application that involves retrieving data from a .Net web service. The web service returns an array of Locations. A Location is pretty simple, it has 3 properties – an integer and two strings. So that the rest of my application does not have to be dependent on this web service, I would li...

Is there any built-in control in ASP.NET other than `dropdownlist` to display time?

I want to display time starting from 8AM To 7PM With interval 15 minutes. So: 8.15AM 8.30AM 8.45AM 9AM 9.15AM 9.30AM In a dropdownlist. Is there any built-in control in ASP.NET other than dropdownlist to display time? ...

ASP.NET Partial Page Class Names Best Practices

Hi, When you create a new asp.net page in VS 2008 and choose code behind, it also creates the typical aspx.vb or aspx.cs file to go along with it. At the top of those files, VS names the 'Partial Class' name the file structure and/or name of the aspx file. The question: Is there a best practice for this? Can I just use a single class...

Copy Icon into Startup Folder Using VB.Net

I'd like to copy an icon into the computer's startup folder from vb.net code. ...

Export To Excel Fom DataGrid VB.Net Windows Application

I need to Export DataGrids' Contents to Excel using VB.Net for a Window based Application. How to do this.. any ideas ? ...

Grid View Comparison

Hi I want to compare rows of two grid views.GW1 and GW2. When I click a Search Button ,I want to check the Values in the GW2,and if GW1 and GW2 have same PayID ,EmpID,then that specific row of GW1 must be disabled Thanks ...

org charts

How to create org charts in vb.net? ...

Difference between Load event,Activate event and Enter event in the Form

Hi guys, I am using VB.NET for Windows applications. What is the difference between Load event,Activate event and Enter event in the Form and in which order the above event is executed.Please anyone help me. Sivakumar.P ...

How to convert to datetime

hi guys, I have a dropdownlist that displays time only.Like 8:00AM,8:30AM............When i save this time to database i want to save as todays date + time. eg:8:00AM as 03/30/2009 8:00:00:000.Can anybody give appropriate code to convert as above shown eg: I tried Convert.ToDateTime(ddlStartTime.SelectedItem.Text) the one error i...

How can I search an array in VB.NET?

I want to be able to effectively search an array for the contents of a string. Example: dim arr() as string={"ravi","Kumar","Ravi","Ramesh"} I pass the value is "ra" and I want it to return the index of 2 and 3. How can I do this in VB.NET? ...

simple search engine using web developer 2008

I'm working on a simple e-commerce website right now, nothing real just practicing the problem that I'm having is how to make a simple search in the website? i.e. if I want to search for the word "iphone" in the database of the website. how can I do that? and how can I specify a column to search in it instead of searching the whole ta...

Visual Basic - Guess the colour program

I am trying to make a small game in which the computer gives a random code of colours (red green yellow and blue) and then you must try and guess them... I am having trouble making the colours random though. The colours are the backcolour of 4 buttons. The code is four colours long. The player then clicks on some buttons just below that...

Vista + VB.NET - Access Denied while writing to HKEY_LOCAL_MACHINE

I want my program to be able to edit a values within a registry key that resides in 'HKEY_LOCAL_MACHINE' My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\XYZ", "MyValue", "MyData") The above works fine in Windows XP, but throws an UnauthorizedAccessException in Vista. ...

How to set a hyperlink to a text box in code. - with other HTML tags

Hi My code i want to display in a textbox <a href="http://www.erate.co.za/CompanyProfile.aspx?ID=112"&gt; <img src="http://www.erate.co.za/CompanyAdd.bmp" alt="Go rate us on www.eRate.co.za" border="0" style="width: 136px; height: 88px" /></a> But i get the ID from a Reader like this reader.Item("ID").ToString Now i want to se...

Vista + VB.NET - Access is denied while trying to start/stop a Windows Service from within an application

I get the following error in Vista while trying to start/stop a Windows Service that I created. Cannot open ServiceName service on computer '.'. The same code works for XP. What should I do to solve this problem? ...

How to avoid a database race condition when manually incrementing PK of new row.

Hi! I have a legacy data table in SQL Server 2005 that has a PK with no identity/autoincrement and no power to implement one. As a result, I am forced to create new records in ASP.NET manually via the ole "SELECT MAX(id) + 1 FROM table"-before-insert technique. Obviously this creates a race condition on the ID in the event of simulta...

In WPF, how can I add a border to a control in code behind?

In my XAML I want to dynamically generate a ListBox with the following: <ListBox Name="MainListBox"> <Border Style="{DynamicResource ListBoxItemRoundedBorder}"> <ListBoxItem > <TextBlock> Some Text Here </TextBlock> </ListBoxItem> </Border> <Border Style="{DynamicResource ListBoxItemRoundedBor...

Any idea why VS2008 crashes reliably at the end of a solution rebuild?

VS2008 SP1, Winforms solution, VB.NET, compiling for x86 and .NET v2 I have about a dozen projects in the solution, with a couple of Windows forms projects and some class libraries. If I rebuild the solution, it clears out and recompiles all the projects, as you'd expect... ... and then disappears without trace or error message. Sin...

Export to Excel

I would like to export a GridView to excel, which is easy enough. But above the grid, in Excel, I would like some other information for identification. Can I somehow export things other than gridviews while then putting in the gridview below? Edit: For some reason when the GridView1 is visible and I try to export, the entire page export...

Entity Framework Insert In Code

I have a simple Entity Framework. For simplicity's sake I will transform the entity names to Northwind Like. I have a IEnumerable Of Customer and Item Objects I am trying to Create Orders which of course is made up (simplistically) of an Item and A Customer. How can I go about creating and inserting these Orders? -Hcane ...