vb.net

Visual Studio 2003, Macro, Process.Attach not working always

I'm using Visual Studio 2003, and I have a macro similar to this: Dte.Debugger.DetachAll() For Each proc As EnvDTE.Process In DTE.Debugger.LocalProcesses If proc.Name.IndexOf("ehexthost.exe") <> -1 Then proc.Attach() End If Next The first time use the macro, it works fine. Each subsequent time,...

Porting a VB6 application with msflexgrid to vb.Net

I am porting a vb6 application to VB.net. One of the key forms has a large msflexgrid on it - about a 1000 columns and 50 rows. It has 2 header rows - the first header row has merged cells to form a main header and the second row has sub headings. There is no requirement for any data entry and it's unbound. The code does the work in deci...

Managing connection to database in an asp.net application

I would like to know, what would be the best way to manage a connection to a database in asp.net. My application is built using an N-Tier architecture. The DAL consists of static classes with methods such as Public Shared Sub Delete( _ ByVal connection As MyConnectionClass, _ ByVal contact_id As Integer, _ ByVal contact_tim...

How can i find out what version of IIS i need to deploy ASP.NET+VB App?

I just got application written in ASP.NET and VB, can i deploy it on any IIS? Are there any files in project with that kind of information? ...

How can I always enable raising a dialog asking for a smart card pin?

Scenario I'm trying to use certificates to sign documents. The first time that I sign, the OS prompts a dialog for user to set the PIN, but the next times it doesn’t. For security reasons, I need that every time that I sign, the OS asks the PIN to the user. Anyone knows how to do that? This is the code: ''// create ContentInfo Dim co...

Database history for client usage

Hey, I'm trying to figure out what would be the best way to have a history on a database, to track any Insert/Delete/Update that is done. The history data will need to be coded into the front-end since it will be used by the users. Creating "history tables" (a copy of each table used to store history) is not a good way to do this, sin...

How do I do queries against hierarchical data using LINQ to SQL?

I have 2 tables that are related. each app can relate to many apps. ie, office can be related to word, excel....... app id PK int appname varchar(50) ..... appsrelated relatedid int fk to app.id appid int sample data app id, appname 1, office 2, word 3, excel 4, quake appsrelated relatedid, appid 1, 2 1, 3 basically new to linq t...

Problem injecting a VB parameter into a stored procedure (FireBird)

Everyone here has always been such great help, either directly or indirectly. And it is with grand hope that this, yet again, rings true. For clarification sakes, the Stored Procedure is running under FireBird and the VB is of the .NET variety I have a stored procedure (excerpt below, important bit is the WHERE) select pn, pnm.desc...

How to detect if a scrollbar is or is not at the end of a richtextbox (vb.net)

Hi, my question is as is:How to detect if a scrollbar is at or not at the end of a richtextbox? edit: when I say at the end I mean completely scrolled to the bottom, not anywhere else. ...

To get the commandargument in rowdatabound event in gridview

hi guys, Following is code for buttonclick in gridview. Protected Sub lnkChangeStatus_Click(ByVal sender As Object, ByVal e As EventArgs) Dim gvr As GridViewRow = TryCast(DirectCast(sender, LinkButton).Parent.Parent, GridViewRow) Dim lngProfileId As Long = Convert.ToInt64(gvwBusinessProfiles.DataKeys(gvr.RowIndex).Va...

RunTime Error

hi guys, I am running a shopping cart application in asp.net.I am running my application in IIS.I am getting following error while running. Server Error in '/cart' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the spec...

Delete dynamically generated PDF file immediately after it has been displayed to user

I'm creating a PDF file on the fly using ITextSharp and ASP.NET 1.1. My process is as follows - Create file on server Redirect browser to newly created PDF file so it is displayed to user What I'd like to do is delete the PDF from the server as soon it is displayed in the users browser. The PDF file is large so it is not an option t...

Best practice for DLL calling an object in the EXE

I'm building a DLL with several "master" objects that need access to the app LINQ DataContext. The DLL will serve several projects with different dataContexts, so I need the DLL can call the object that it's inside the EXE. What is the best or elegant way to do it? Edit: Clarification Code example of what I'm trying to do: 'DLL '--- P...

How to get image with its name and any extension?

I am building an asp.net website. I want to show image on the page, but while I know the image name, I don't know the extension. So, I want to open the images directory and get the image by its name whatever its extension. ...

Custom Watermarked Textbox behaving strangely

SOLUTION: Thanks to Patrick below, I have refactored the C# CodeProject version into a VB.NET version that works for me. Hopefully it can help you guys as well: Partial Public Class WatermarkedTextBox Inherits TextBox Private _waterMarkColor As Color = Color.LightGray Public Property WaterMarkColor() As Color Get ...

Convert OSGB 36 co-ordinates to Latitude/Longitude

I want to convert British OSGB 36 co-ordinates to WGS 84 (i.e. "standard" latitude and longitude), in order to plot them into a KML file for Google Earth. What would be the best way to go about this? I'm implementing in VB .NET. I should probably add that my question is not "How do I write a KML file?". My question is "How do I convert...

Where is the correct place to format a string in .NET?

We have a field called employee number in our database. It is char(10) field. we are storing the numbers right justified. so we are storing the numbers as " 1", " 2" etc. I am not sure why we started doing this because it happened before I started working here. Because of this, each function in the business logic that h...

In a datacontext are inserted values not available within the datacontext until after submitchanges?

I'm going through an XML file of articles and the journalist(s) that wrote them. As we are adding the articles into _Data our datacontext we may come across a journalist that needs adding so we do this: newJourno = New journalist With {.name = strJournalist} _Data.journalists.InsertOnSubmit(newJourno) .articles_journalists.Add(New artic...

Enterprise Library Strong Naming Guidance Package

Dear GOD! For the life of me I can not find the Enterprise Library Strong Naming Guidance Package download for Enterprise Library 4.1 I need this to sign the assemblies to add them to the GAC. Does anybody know where I can find it? I can't find it anywhere on the www.codeplex.com/entlib or www.codeplex.com/entlibcontrib websites. HE...

Can I replace vbLf and Chr() with constants?

We're trying to trim the number of assemblies we load during startup, and one of the easiest to cut is the Microsoft.VisualBasic assembly. There are alot of things in it that were easy enough to replace, like Left(), but I'm struggling to find a good way to replace vbLf and Chr(). vbCrLf was easy enough to replace with Environment.NewLin...