Click here to Skip to main content
15,908,907 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Adding a column to an existing SQL database table Pin
Christian Graus22-Apr-07 12:08
protectorChristian Graus22-Apr-07 12:08 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw22-Apr-07 17:28
furjaw22-Apr-07 17:28 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw22-Apr-07 17:30
furjaw22-Apr-07 17:30 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw22-Apr-07 18:46
furjaw22-Apr-07 18:46 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw22-Apr-07 18:54
furjaw22-Apr-07 18:54 
GeneralRe: Adding a column to an existing SQL database table Pin
Dave Kreskowiak23-Apr-07 3:54
mveDave Kreskowiak23-Apr-07 3:54 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw25-Apr-07 13:58
furjaw25-Apr-07 13:58 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw25-Apr-07 18:18
furjaw25-Apr-07 18:18 
OK, here is my programming attempt:

Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sqlConnection As New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\patient.mdf;Integrated Security=True;User Instance=True")
Dim command As New System.Data.SqlClient.SqlCommand
command.CommandText = "ALTER TABLE Patient ADD CaseNbr Varchar(50)')"
sqlConnection.Open()
command.ExecuteNonQuery()
sqlConnection.Close()
End Sub
End Class

I got the following error when I executed:

An attempt to attach an auto-named database for file C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\Add Column\Add Column\bin\Debug\patient.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw25-Apr-07 18:45
furjaw25-Apr-07 18:45 
GeneralRe: Adding a column to an existing SQL database table Pin
Dave Kreskowiak26-Apr-07 13:35
mveDave Kreskowiak26-Apr-07 13:35 
GeneralRe: Adding a column to an existing SQL database table Pin
furjaw27-Apr-07 12:41
furjaw27-Apr-07 12:41 
QuestionShow database information in listbox using SELECT query Pin
keninfo21-Apr-07 10:29
keninfo21-Apr-07 10:29 
AnswerRe: Show database information in listbox using SELECT query Pin
Dave Kreskowiak21-Apr-07 11:47
mveDave Kreskowiak21-Apr-07 11:47 
GeneralRe: Show database information in listbox using SELECT query Pin
keninfo22-Apr-07 9:17
keninfo22-Apr-07 9:17 
QuestionDeployment Error Pin
reykentj21-Apr-07 2:54
reykentj21-Apr-07 2:54 
AnswerRe: Deployment Error Pin
Dave Kreskowiak21-Apr-07 11:38
mveDave Kreskowiak21-Apr-07 11:38 
GeneralRe: Deployment Error Pin
reykentj21-Apr-07 14:28
reykentj21-Apr-07 14:28 
GeneralRe: Deployment Error Pin
Dave Kreskowiak22-Apr-07 4:43
mveDave Kreskowiak22-Apr-07 4:43 
GeneralRe: Deployment Error Pin
reykentj22-Apr-07 9:13
reykentj22-Apr-07 9:13 
QuestionBHO with VB Pin
wayiming21-Apr-07 1:31
wayiming21-Apr-07 1:31 
AnswerRe: BHO with VB Pin
Sathesh Sakthivel21-Apr-07 2:31
Sathesh Sakthivel21-Apr-07 2:31 
AnswerRe: BHO with VB Pin
wayiming21-Apr-07 2:55
wayiming21-Apr-07 2:55 
GeneralRe: BHO with VB Pin
Sathesh Sakthivel21-Apr-07 6:15
Sathesh Sakthivel21-Apr-07 6:15 
GeneralRe: BHO with VB Pin
wayiming21-Apr-07 17:30
wayiming21-Apr-07 17:30 
Questioncreate flowlayoutpanel by code Pin
reyhane20-Apr-07 21:35
reyhane20-Apr-07 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.