Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Friday, March 9, 2012

error 0xE0040200

Hello,

I′ve got this problem when I′m creating a new cube with the Microsoft Visual Studio 2005 8.0.550727.42 (RTM.050727-4200) and my operative system is Microsoft(R) Windows(R) Server 2003, Standard Edition. It isn′t the first cube I′ve created in this project, but it′s the the first time I get the problem.

Could someone help me?

Can you provide bit more informatio about the problem.

At what point you are getting the error?
Is that at deployment time or you get the error while running Cube Wizard?

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||I′m getting the error when I′m browsing the cube using the third level of a hierarchy. It happens whit all the hierarchies of the project so I think It isn′t a problem of the hierarchy.|||

Try installing SP1 of SQL server and see if the same problem happens.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Wednesday, March 7, 2012

Error 07002 - SQLBindParameter not used for all parameters

Hi, I created a simple VB.NET 2003 application through Visual Studio
that connects to a MySQL database and loads a table into a Dataset, and
then displays that table information in a DataGrid on a form for
editing. The table fill works fine, the delete function works fine, but
when I try to update a row, the application fails with the following
error message:
An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred
in system.data.dll
Additional information: System error.
'Data Access VB App.exe': Loaded
'c:\windows\assembly\gac\microsoft.visualbasic\7.0 .5000.0__b03f5f7f11d50
a3a\microsoft.visualbasic.dll', No symbols loaded.
Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [07002]
[MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]SQLBindParameter not used
for all parameters
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
at Data_Access_VB_App.Form1.btnUpdate_Click(Object sender, EventArgs
e) in C:\Documents and Settings\System Admin\My Documents\Visual Studio
Projects\Data Access VB App\Form1.vb:line 225
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProThe program '[2608] Data Access
VB App.exe' has exited with code 0 (0x0).
c(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG&
msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeM
ethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32
reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Data_Access_VB_App.Form1.Main() in C:\Documents and
Settings\System Admin\My Documents\Visual Studio Projects\Data Access VB
App\Form1.vb:line 1
The majority of the code was generated by Visual Studio and based on the
error message it would seem that I have to add SQLBindParameter
statements, but I am not sure the syntax that I should be using. I am
new to VB.NET (coming from Java/J2EE) and haven't been able to come up
with a workable solution after pouring over the MSDN manuals. Here is
the generated code:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents OdbcDataAdapter1 As
System.Data.Odbc.OdbcDataAdapter
Friend WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
Friend WithEvents DsTags1 As Data_Access_VB_App.dsTags
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents btnUpdate As System.Windows.Forms.Button
Friend WithEvents btnLoad As System.Windows.Forms.Button
Friend WithEvents OdbcDataAdapter2 As
System.Data.Odbc.OdbcDataAdapter
Friend WithEvents OdbcSelectCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcInsertCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcConnection2 As System.Data.Odbc.OdbcConnection
Friend WithEvents OdbcDeleteCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcUpdateCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcSelectCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcInsertCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcDeleteCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcUpdateCommand1 As System.Data.Odbc.OdbcCommand
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
Me.DsTags1 = New Data_Access_VB_App.dsTags
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.btnUpdate = New System.Windows.Forms.Button
Me.btnLoad = New System.Windows.Forms.Button
Me.OdbcDataAdapter2 = New System.Data.Odbc.OdbcDataAdapter
Me.OdbcDeleteCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcConnection2 = New System.Data.Odbc.OdbcConnection
Me.OdbcInsertCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcSelectCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdateCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcDeleteCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdateCommand1 = New System.Data.Odbc.OdbcCommand
CType(Me.DsTags1,
System.ComponentModel.ISupportInitialize).BeginIni t()
CType(Me.DataGrid1,
System.ComponentModel.ISupportInitialize).BeginIni t()
Me.SuspendLayout()
'
'OdbcDataAdapter1
'
Me.OdbcDataAdapter1.DeleteCommand = Me.OdbcDeleteCommand1
Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
Me.OdbcDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "epctag", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("ID", "ID"), New
System.Data.Common.DataColumnMapping("OBJECT_EPC", "OBJECT_EPC"), New
System.Data.Common.DataColumnMapping("READER_EPC", "READER_EPC"), New
System.Data.Common.DataColumnMapping("DATE_TIME", "DATE_TIME"), New
System.Data.Common.DataColumnMapping("PAYLOAD", "PAYLOAD"), New
System.Data.Common.DataColumnMapping("GTIN_DOMAIN" , "GTIN_DOMAIN"), New
System.Data.Common.DataColumnMapping("GTIN_CLASS", "GTIN_CLASS")})})
Me.OdbcDataAdapter1.UpdateCommand = Me.OdbcUpdateCommand1
'
'OdbcConnection1
'
Me.OdbcConnection1.ConnectionString =
"STMT=;OPTION=3;DSN=EPCThingsNET;UID=root;SOCKET=; DESC=MySQL ODBC 3.51
Driver DSN;" & _
"DATABASE=thingsnet;SERVER=localhost;PORT=3306 "
'
'DsTags1
'
Me.DsTags1.DataSetName = "dsTags"
Me.DsTags1.Locale = New
System.Globalization.CultureInfo("en-US")
'
'DataGrid1
'
Me.DataGrid1.DataMember = "epctag"
Me.DataGrid1.DataSource = Me.DsTags1
Me.DataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(8, 128)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(584, 264)
Me.DataGrid1.TabIndex = 0
'
'btnUpdate
'
Me.btnUpdate.Location = New System.Drawing.Point(224, 48)
Me.btnUpdate.Name = "btnUpdate"
Me.btnUpdate.Size = New System.Drawing.Size(152, 23)
Me.btnUpdate.TabIndex = 1
Me.btnUpdate.Text = "Save Changes in Database"
'
'btnLoad
'
Me.btnLoad.Location = New System.Drawing.Point(56, 40)
Me.btnLoad.Name = "btnLoad"
Me.btnLoad.TabIndex = 2
Me.btnLoad.Text = "Load Data"
'
'OdbcSelectCommand1
'
Me.OdbcSelectCommand1.CommandText = "SELECT ID, OBJECT_EPC,
READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, GTIN_CLASS FR" & _
"OM epctag"
Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
'
'OdbcInsertCommand1
'
Me.OdbcInsertCommand1.CommandText = "INSERT INTO epctag(ID,
OBJECT_EPC, READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, G" & _
"TIN_CLASS) VALUES (?, ?, ?, ?, ?, ?, ?)"
Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, "ID"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("OBJECT_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("READER_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("DATE_TIME",
System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("PAYLOAD",
System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_CLASS",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
'
'OdbcDeleteCommand1
'
Me.OdbcDeleteCommand1.CommandText = "DELETE FROM epctag WHERE
(ID = ?)"
Me.OdbcDeleteCommand1.Connection = Me.OdbcConnection1
Me.OdbcDeleteCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
'
'OdbcUpdateCommand1
'
Me.OdbcUpdateCommand1.CommandText = "UPDATE ecptag SET ID = ?,
OBJECT_EPC = ?, READER_EPC = ?, DATE_TIME = ?, PAYLOAD " & _
"= ?, GTIN_DOMAIN = ?, GTIN_CLASS = ? WHERE (ID = ?)"
Me.OdbcUpdateCommand1.Connection = Me.OdbcConnection1
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, "ID"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("OBJECT_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("READER_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("DATE_TIME",
System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("PAYLOAD",
System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_CLASS",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(608, 398)
Me.Controls.Add(Me.btnLoad)
Me.Controls.Add(Me.btnUpdate)
Me.Controls.Add(Me.DataGrid1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.DsTags1,
System.ComponentModel.ISupportInitialize).EndInit( )
CType(Me.DataGrid1,
System.ComponentModel.ISupportInitialize).EndInit( )
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUpdate.Click
OdbcDataAdapter1.Update(DsTags1)
MessageBox.Show("Database Updated!")
End Sub
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click
OdbcDataAdapter1.Fill(DsTags1)
MessageBox.Show("Data Table Loaded Successfully!")
End Sub
End Class
That's the long and short of it! Appreciate any help.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
You aren't binding the correct number of parameters for the update command.
You are expecting ODBC to use the "ID" parameter twice, but that wont
happen. You have to bind an OdbcParameter object for each '?'. If you have
8 parameter markers, you must bind 8 parameters. You are only binding 7
parameters.
Brannon
"Mikey G" <nospam@.devdex.com> wrote in message
news:#M02y8hsEHA.2808@.TK2MSFTNGP14.phx.gbl...
> Hi, I created a simple VB.NET 2003 application through Visual Studio
> that connects to a MySQL database and loads a table into a Dataset, and
> then displays that table information in a DataGrid on a form for
> editing. The table fill works fine, the delete function works fine, but
> when I try to update a row, the application fails with the following
> error message:
> An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred
> in system.data.dll
> Additional information: System error.
> 'Data Access VB App.exe': Loaded
> 'c:\windows\assembly\gac\microsoft.visualbasic\7.0 .5000.0__b03f5f7f11d50
> a3a\microsoft.visualbasic.dll', No symbols loaded.
> Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [07002]
> [MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]SQLBindParameter not used
> for all parameters
> at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
> DataTableMapping tableMapping)
> at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
> srcTable)
> at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
> at Data_Access_VB_App.Form1.btnUpdate_Click(Object sender, EventArgs
> e) in C:\Documents and Settings\System Admin\My Documents\Visual Studio
> Projects\Data Access VB App\Form1.vb:line 225
> at System.Windows.Forms.Control.OnClick(EventArgs e)
> at System.Windows.Forms.Button.OnClick(EventArgs e)
> at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
> button, Int32 clicks)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.ButtonBase.WndProc(Message& m)
> at System.Windows.Forms.Button.WndProThe program '[2608] Data Access
> VB App.exe' has exited with code 0 (0x0).
> c(Message& m)
> at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
> at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
> at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
> Int32 msg, IntPtr wparam, IntPtr lparam)
> at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG&
> msg)
> at
> System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeM
> ethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32
> reason, Int32 pvLoopData)
> at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32
> reason, ApplicationContext context)
> at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
> ApplicationContext context)
> at System.Windows.Forms.Application.Run(Form mainForm)
> at Data_Access_VB_App.Form1.Main() in C:\Documents and
> Settings\System Admin\My Documents\Visual Studio Projects\Data Access VB
> App\Form1.vb:line 1
>
> The majority of the code was generated by Visual Studio and based on the
> error message it would seem that I have to add SQLBindParameter
> statements, but I am not sure the syntax that I should be using. I am
> new to VB.NET (coming from Java/J2EE) and haven't been able to come up
> with a workable solution after pouring over the MSDN manuals. Here is
> the generated code:
>
> Public Class Form1
> Inherits System.Windows.Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
> Boolean)
> If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'NOTE: The following procedure is required by the Windows Form Designer
> 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents OdbcDataAdapter1 As
> System.Data.Odbc.OdbcDataAdapter
> Friend WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
> Friend WithEvents DsTags1 As Data_Access_VB_App.dsTags
> Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
> Friend WithEvents btnUpdate As System.Windows.Forms.Button
> Friend WithEvents btnLoad As System.Windows.Forms.Button
> Friend WithEvents OdbcDataAdapter2 As
> System.Data.Odbc.OdbcDataAdapter
> Friend WithEvents OdbcSelectCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcInsertCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcConnection2 As System.Data.Odbc.OdbcConnection
> Friend WithEvents OdbcDeleteCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcUpdateCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcSelectCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcInsertCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcDeleteCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcUpdateCommand1 As System.Data.Odbc.OdbcCommand
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
> InitializeComponent()
> Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
> Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
> Me.DsTags1 = New Data_Access_VB_App.dsTags
> Me.DataGrid1 = New System.Windows.Forms.DataGrid
> Me.btnUpdate = New System.Windows.Forms.Button
> Me.btnLoad = New System.Windows.Forms.Button
> Me.OdbcDataAdapter2 = New System.Data.Odbc.OdbcDataAdapter
> Me.OdbcDeleteCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcConnection2 = New System.Data.Odbc.OdbcConnection
> Me.OdbcInsertCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcSelectCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcUpdateCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcDeleteCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcUpdateCommand1 = New System.Data.Odbc.OdbcCommand
> CType(Me.DsTags1,
> System.ComponentModel.ISupportInitialize).BeginIni t()
> CType(Me.DataGrid1,
> System.ComponentModel.ISupportInitialize).BeginIni t()
> Me.SuspendLayout()
> '
> 'OdbcDataAdapter1
> '
> Me.OdbcDataAdapter1.DeleteCommand = Me.OdbcDeleteCommand1
> Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
> Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
> Me.OdbcDataAdapter1.TableMappings.AddRange(New
> System.Data.Common.DataTableMapping() {New
> System.Data.Common.DataTableMapping("Table", "epctag", New
> System.Data.Common.DataColumnMapping() {New
> System.Data.Common.DataColumnMapping("ID", "ID"), New
> System.Data.Common.DataColumnMapping("OBJECT_EPC", "OBJECT_EPC"), New
> System.Data.Common.DataColumnMapping("READER_EPC", "READER_EPC"), New
> System.Data.Common.DataColumnMapping("DATE_TIME", "DATE_TIME"), New
> System.Data.Common.DataColumnMapping("PAYLOAD", "PAYLOAD"), New
> System.Data.Common.DataColumnMapping("GTIN_DOMAIN" , "GTIN_DOMAIN"), New
> System.Data.Common.DataColumnMapping("GTIN_CLASS", "GTIN_CLASS")})})
> Me.OdbcDataAdapter1.UpdateCommand = Me.OdbcUpdateCommand1
> '
> 'OdbcConnection1
> '
> Me.OdbcConnection1.ConnectionString =
> "STMT=;OPTION=3;DSN=EPCThingsNET;UID=root;SOCKET=; DESC=MySQL ODBC 3.51
> Driver DSN;" & _
> "DATABASE=thingsnet;SERVER=localhost;PORT=3306 "
> '
> 'DsTags1
> '
> Me.DsTags1.DataSetName = "dsTags"
> Me.DsTags1.Locale = New
> System.Globalization.CultureInfo("en-US")
> '
> 'DataGrid1
> '
> Me.DataGrid1.DataMember = "epctag"
> Me.DataGrid1.DataSource = Me.DsTags1
> Me.DataGrid1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText
> Me.DataGrid1.Location = New System.Drawing.Point(8, 128)
> Me.DataGrid1.Name = "DataGrid1"
> Me.DataGrid1.Size = New System.Drawing.Size(584, 264)
> Me.DataGrid1.TabIndex = 0
> '
> 'btnUpdate
> '
> Me.btnUpdate.Location = New System.Drawing.Point(224, 48)
> Me.btnUpdate.Name = "btnUpdate"
> Me.btnUpdate.Size = New System.Drawing.Size(152, 23)
> Me.btnUpdate.TabIndex = 1
> Me.btnUpdate.Text = "Save Changes in Database"
> '
> 'btnLoad
> '
> Me.btnLoad.Location = New System.Drawing.Point(56, 40)
> Me.btnLoad.Name = "btnLoad"
> Me.btnLoad.TabIndex = 2
> Me.btnLoad.Text = "Load Data"
> '
> 'OdbcSelectCommand1
> '
> Me.OdbcSelectCommand1.CommandText = "SELECT ID, OBJECT_EPC,
> READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, GTIN_CLASS FR" & _
> "OM epctag"
> Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
> '
> 'OdbcInsertCommand1
> '
> Me.OdbcInsertCommand1.CommandText = "INSERT INTO epctag(ID,
> OBJECT_EPC, READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, G" & _
> "TIN_CLASS) VALUES (?, ?, ?, ?, ?, ?, ?)"
> Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, "ID"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("OBJECT_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("READER_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("DATE_TIME",
> System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("PAYLOAD",
> System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_CLASS",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
> '
> 'OdbcDeleteCommand1
> '
> Me.OdbcDeleteCommand1.CommandText = "DELETE FROM epctag WHERE
> (ID = ?)"
> Me.OdbcDeleteCommand1.Connection = Me.OdbcConnection1
> Me.OdbcDeleteCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
> Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
> '
> 'OdbcUpdateCommand1
> '
> Me.OdbcUpdateCommand1.CommandText = "UPDATE ecptag SET ID = ?,
> OBJECT_EPC = ?, READER_EPC = ?, DATE_TIME = ?, PAYLOAD " & _
> "= ?, GTIN_DOMAIN = ?, GTIN_CLASS = ? WHERE (ID = ?)"
> Me.OdbcUpdateCommand1.Connection = Me.OdbcConnection1
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, "ID"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("OBJECT_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("READER_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("DATE_TIME",
> System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("PAYLOAD",
> System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_CLASS",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
> '
> 'Form1
> '
> Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> Me.ClientSize = New System.Drawing.Size(608, 398)
> Me.Controls.Add(Me.btnLoad)
> Me.Controls.Add(Me.btnUpdate)
> Me.Controls.Add(Me.DataGrid1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> CType(Me.DsTags1,
> System.ComponentModel.ISupportInitialize).EndInit( )
> CType(Me.DataGrid1,
> System.ComponentModel.ISupportInitialize).EndInit( )
> Me.ResumeLayout(False)
> End Sub
> #End Region
> Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles btnUpdate.Click
> OdbcDataAdapter1.Update(DsTags1)
> MessageBox.Show("Database Updated!")
> End Sub
> Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles btnLoad.Click
> OdbcDataAdapter1.Fill(DsTags1)
> MessageBox.Show("Data Table Loaded Successfully!")
> End Sub
> End Class
>
> That's the long and short of it! Appreciate any help.
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!

Error 07002 - SQLBindParameter not used for all parameters

Hi, I created a simple VB.NET 2003 application through Visual Studio
that connects to a mysql database and loads a table into a Dataset, and
then displays that table information in a DataGrid on a form for
editing. The table fill works fine, the delete function works fine, but
when I try to update a row, the application fails with the following
error message:
An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred
in system.data.dll
Additional information: System error.
'Data Access VB App.exe': Loaded
'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50
a3a\microsoft.visualbasic.dll', No symbols loaded.
Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [07002]
[MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]SQLBindParameter n
ot used
for all parameters
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
at Data_Access_VB_App.Form1.btnUpdate_Click(Object sender, EventArgs
e) in C:\Documents and Settings\System Admin\My Documents\Visual Studio
Projects\Data Access VB App\Form1.vb:line 225
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProThe program '[2608] Data Access
VB App.exe' has exited with code 0 (0x0).
c(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeM
ethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32
reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Data_Access_VB_App.Form1.Main() in C:\Documents and
Settings\System Admin\My Documents\Visual Studio Projects\Data Access VB
App\Form1.vb:line 1
The majority of the code was generated by Visual Studio and based on the
error message it would seem that I have to add SQLBindParameter
statements, but I am not sure the syntax that I should be using. I am
new to VB.NET (coming from Java/J2EE) and haven't been able to come up
with a workable solution after pouring over the MSDN manuals. Here is
the generated code:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents OdbcDataAdapter1 As
System.Data.Odbc.OdbcDataAdapter
Friend WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
Friend WithEvents DsTags1 As Data_Access_VB_App.dsTags
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents btnUpdate As System.Windows.Forms.Button
Friend WithEvents btnLoad As System.Windows.Forms.Button
Friend WithEvents OdbcDataAdapter2 As
System.Data.Odbc.OdbcDataAdapter
Friend WithEvents OdbcSelectCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcInsertCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcConnection2 As System.Data.Odbc.OdbcConnection
Friend WithEvents OdbcDeleteCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcUpdateCommand2 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcSelectCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcInsertCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcDeleteCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcUpdateCommand1 As System.Data.Odbc.OdbcCommand
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
Me.DsTags1 = New Data_Access_VB_App.dsTags
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.btnUpdate = New System.Windows.Forms.Button
Me.btnLoad = New System.Windows.Forms.Button
Me.OdbcDataAdapter2 = New System.Data.Odbc.OdbcDataAdapter
Me.OdbcDeleteCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcConnection2 = New System.Data.Odbc.OdbcConnection
Me.OdbcInsertCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcSelectCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdateCommand2 = New System.Data.Odbc.OdbcCommand
Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcDeleteCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdateCommand1 = New System.Data.Odbc.OdbcCommand
CType(Me.DsTags1,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataGrid1,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'OdbcDataAdapter1
'
Me.OdbcDataAdapter1.DeleteCommand = Me.OdbcDeleteCommand1
Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
Me.OdbcDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "epctag", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("ID", "ID"), New
System.Data.Common.DataColumnMapping("OBJECT_EPC", "OBJECT_EPC"), New
System.Data.Common.DataColumnMapping("READER_EPC", "READER_EPC"), New
System.Data.Common.DataColumnMapping("DATE_TIME", "DATE_TIME"), New
System.Data.Common.DataColumnMapping("PAYLOAD", "PAYLOAD"), New
System.Data.Common.DataColumnMapping("GTIN_DOMAIN", "GTIN_DOMAIN"), New
System.Data.Common.DataColumnMapping("GTIN_CLASS", "GTIN_CLASS")})})
Me.OdbcDataAdapter1.UpdateCommand = Me.OdbcUpdateCommand1
'
'OdbcConnection1
'
Me.OdbcConnection1.ConnectionString =
" STMT=;OPTION=3;DSN=EPCThingsNET;UID=root
;SOCKET=;DESC=MySQL ODBC 3.51
Driver DSN;" & _
" DATABASE=thingsnet;SERVER=localhost;PORT
=3306"
'
'DsTags1
'
Me.DsTags1.DataSetName = "dsTags"
Me.DsTags1.Locale = New
System.Globalization.CultureInfo("en-US")
'
'DataGrid1
'
Me.DataGrid1.DataMember = "epctag"
Me.DataGrid1.DataSource = Me.DsTags1
Me.DataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(8, 128)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(584, 264)
Me.DataGrid1.TabIndex = 0
'
'btnUpdate
'
Me.btnUpdate.Location = New System.Drawing.Point(224, 48)
Me.btnUpdate.Name = "btnUpdate"
Me.btnUpdate.Size = New System.Drawing.Size(152, 23)
Me.btnUpdate.TabIndex = 1
Me.btnUpdate.Text = "Save Changes in Database"
'
'btnLoad
'
Me.btnLoad.Location = New System.Drawing.Point(56, 40)
Me.btnLoad.Name = "btnLoad"
Me.btnLoad.TabIndex = 2
Me.btnLoad.Text = "Load Data"
'
'OdbcSelectCommand1
'
Me.OdbcSelectCommand1.CommandText = "SELECT ID, OBJECT_EPC,
READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, GTIN_CLASS FR" & _
"OM epctag"
Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
'
'OdbcInsertCommand1
'
Me.OdbcInsertCommand1.CommandText = "INSERT INTO epctag(ID,
OBJECT_EPC, READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, G" & _
"TIN_CLASS) VALUES (?, ?, ?, ?, ?, ?, ?)"
Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, "ID"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("OBJECT_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("READER_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("DATE_TIME",
System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("PAYLOAD",
System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
Me.OdbcInsertCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_CLASS",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
'
'OdbcDeleteCommand1
'
Me.OdbcDeleteCommand1.CommandText = "DELETE FROM epctag WHERE
(ID = ?)"
Me.OdbcDeleteCommand1.Connection = Me.OdbcConnection1
Me.OdbcDeleteCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
'
'OdbcUpdateCommand1
'
Me.OdbcUpdateCommand1.CommandText = "UPDATE ecptag SET ID = ?,
OBJECT_EPC = ?, READER_EPC = ?, DATE_TIME = ?, PAYLOAD " & _
"= ?, GTIN_DOMAIN = ?, GTIN_CLASS = ? WHERE (ID = ?)"
Me.OdbcUpdateCommand1.Connection = Me.OdbcConnection1
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
0, "ID"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("OBJECT_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("READER_EPC",
System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("DATE_TIME",
System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("PAYLOAD",
System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
Me.OdbcUpdateCommand1.Parameters.Add(New
System.Data.Odbc.OdbcParameter("GTIN_CLASS",
System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(608, 398)
Me.Controls.Add(Me.btnLoad)
Me.Controls.Add(Me.btnUpdate)
Me.Controls.Add(Me.DataGrid1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.DsTags1,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DataGrid1,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUpdate.Click
OdbcDataAdapter1.Update(DsTags1)
MessageBox.Show("Database Updated!")
End Sub
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click
OdbcDataAdapter1.Fill(DsTags1)
MessageBox.Show("Data Table Loaded Successfully!")
End Sub
End Class
That's the long and short of it! Appreciate any help.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!You aren't binding the correct number of parameters for the update command.
You are expecting ODBC to use the "ID" parameter twice, but that wont
happen. You have to bind an OdbcParameter object for each '?'. If you have
8 parameter markers, you must bind 8 parameters. You are only binding 7
parameters.
Brannon
"Mikey G" <nospam@.devdex.com> wrote in message
news:#M02y8hsEHA.2808@.TK2MSFTNGP14.phx.gbl...
> Hi, I created a simple VB.NET 2003 application through Visual Studio
> that connects to a mysql database and loads a table into a Dataset, and
> then displays that table information in a DataGrid on a form for
> editing. The table fill works fine, the delete function works fine, but
> when I try to update a row, the application fails with the following
> error message:
> An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred
> in system.data.dll
> Additional information: System error.
> 'Data Access VB App.exe': Loaded
> 'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50
> a3a\microsoft.visualbasic.dll', No symbols loaded.
> Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [07002]
> [MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]SQLBindParameter
not used
> for all parameters
> at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
> DataTableMapping tableMapping)
> at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
> srcTable)
> at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
> at Data_Access_VB_App.Form1.btnUpdate_Click(Object sender, EventArgs
> e) in C:\Documents and Settings\System Admin\My Documents\Visual Studio
> Projects\Data Access VB App\Form1.vb:line 225
> at System.Windows.Forms.Control.OnClick(EventArgs e)
> at System.Windows.Forms.Button.OnClick(EventArgs e)
> at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
> button, Int32 clicks)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.ButtonBase.WndProc(Message& m)
> at System.Windows.Forms.Button.WndProThe program '[2608] Data Acces
s
> VB App.exe' has exited with code 0 (0x0).
> c(Message& m)
> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
> at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
> Int32 msg, IntPtr wparam, IntPtr lparam)
> at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
> msg)
> at
> System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeM
> ethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32
> reason, Int32 pvLoopData)
> at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
> reason, ApplicationContext context)
> at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
> ApplicationContext context)
> at System.Windows.Forms.Application.Run(Form mainForm)
> at Data_Access_VB_App.Form1.Main() in C:\Documents and
> Settings\System Admin\My Documents\Visual Studio Projects\Data Access VB
> App\Form1.vb:line 1
>
> The majority of the code was generated by Visual Studio and based on the
> error message it would seem that I have to add SQLBindParameter
> statements, but I am not sure the syntax that I should be using. I am
> new to VB.NET (coming from Java/J2EE) and haven't been able to come up
> with a workable solution after pouring over the MSDN manuals. Here is
> the generated code:
>
> Public Class Form1
> Inherits System.Windows.Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
> Boolean)
> If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'NOTE: The following procedure is required by the Windows Form Designer
> 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents OdbcDataAdapter1 As
> System.Data.Odbc.OdbcDataAdapter
> Friend WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
> Friend WithEvents DsTags1 As Data_Access_VB_App.dsTags
> Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
> Friend WithEvents btnUpdate As System.Windows.Forms.Button
> Friend WithEvents btnLoad As System.Windows.Forms.Button
> Friend WithEvents OdbcDataAdapter2 As
> System.Data.Odbc.OdbcDataAdapter
> Friend WithEvents OdbcSelectCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcInsertCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcConnection2 As System.Data.Odbc.OdbcConnection
> Friend WithEvents OdbcDeleteCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcUpdateCommand2 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcSelectCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcInsertCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcDeleteCommand1 As System.Data.Odbc.OdbcCommand
> Friend WithEvents OdbcUpdateCommand1 As System.Data.Odbc.OdbcCommand
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
> InitializeComponent()
> Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
> Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
> Me.DsTags1 = New Data_Access_VB_App.dsTags
> Me.DataGrid1 = New System.Windows.Forms.DataGrid
> Me.btnUpdate = New System.Windows.Forms.Button
> Me.btnLoad = New System.Windows.Forms.Button
> Me.OdbcDataAdapter2 = New System.Data.Odbc.OdbcDataAdapter
> Me.OdbcDeleteCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcConnection2 = New System.Data.Odbc.OdbcConnection
> Me.OdbcInsertCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcSelectCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcUpdateCommand2 = New System.Data.Odbc.OdbcCommand
> Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcDeleteCommand1 = New System.Data.Odbc.OdbcCommand
> Me.OdbcUpdateCommand1 = New System.Data.Odbc.OdbcCommand
> CType(Me.DsTags1,
> System.ComponentModel.ISupportInitialize).BeginInit()
> CType(Me.DataGrid1,
> System.ComponentModel.ISupportInitialize).BeginInit()
> Me.SuspendLayout()
> '
> 'OdbcDataAdapter1
> '
> Me.OdbcDataAdapter1.DeleteCommand = Me.OdbcDeleteCommand1
> Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
> Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
> Me.OdbcDataAdapter1.TableMappings.AddRange(New
> System.Data.Common.DataTableMapping() {New
> System.Data.Common.DataTableMapping("Table", "epctag", New
> System.Data.Common.DataColumnMapping() {New
> System.Data.Common.DataColumnMapping("ID", "ID"), New
> System.Data.Common.DataColumnMapping("OBJECT_EPC", "OBJECT_EPC"), New
> System.Data.Common.DataColumnMapping("READER_EPC", "READER_EPC"), New
> System.Data.Common.DataColumnMapping("DATE_TIME", "DATE_TIME"), New
> System.Data.Common.DataColumnMapping("PAYLOAD", "PAYLOAD"), New
> System.Data.Common.DataColumnMapping("GTIN_DOMAIN", "GTIN_DOMAIN"), New
> System.Data.Common.DataColumnMapping("GTIN_CLASS", "GTIN_CLASS")})})
> Me.OdbcDataAdapter1.UpdateCommand = Me.OdbcUpdateCommand1
> '
> 'OdbcConnection1
> '
> Me.OdbcConnection1.ConnectionString =
> " STMT=;OPTION=3;DSN=EPCThingsNET;UID=root
;SOCKET=;DESC=MySQL ODBC 3.51
> Driver DSN;" & _
> " DATABASE=thingsnet;SERVER=localhost;PORT
=3306"
> '
> 'DsTags1
> '
> Me.DsTags1.DataSetName = "dsTags"
> Me.DsTags1.Locale = New
> System.Globalization.CultureInfo("en-US")
> '
> 'DataGrid1
> '
> Me.DataGrid1.DataMember = "epctag"
> Me.DataGrid1.DataSource = Me.DsTags1
> Me.DataGrid1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText
> Me.DataGrid1.Location = New System.Drawing.Point(8, 128)
> Me.DataGrid1.Name = "DataGrid1"
> Me.DataGrid1.Size = New System.Drawing.Size(584, 264)
> Me.DataGrid1.TabIndex = 0
> '
> 'btnUpdate
> '
> Me.btnUpdate.Location = New System.Drawing.Point(224, 48)
> Me.btnUpdate.Name = "btnUpdate"
> Me.btnUpdate.Size = New System.Drawing.Size(152, 23)
> Me.btnUpdate.TabIndex = 1
> Me.btnUpdate.Text = "Save Changes in Database"
> '
> 'btnLoad
> '
> Me.btnLoad.Location = New System.Drawing.Point(56, 40)
> Me.btnLoad.Name = "btnLoad"
> Me.btnLoad.TabIndex = 2
> Me.btnLoad.Text = "Load Data"
> '
> 'OdbcSelectCommand1
> '
> Me.OdbcSelectCommand1.CommandText = "SELECT ID, OBJECT_EPC,
> READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, GTIN_CLASS FR" & _
> "OM epctag"
> Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
> '
> 'OdbcInsertCommand1
> '
> Me.OdbcInsertCommand1.CommandText = "INSERT INTO epctag(ID,
> OBJECT_EPC, READER_EPC, DATE_TIME, PAYLOAD, GTIN_DOMAIN, G" & _
> "TIN_CLASS) VALUES (?, ?, ?, ?, ?, ?, ?)"
> Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, "ID"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("OBJECT_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("READER_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("DATE_TIME",
> System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("PAYLOAD",
> System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
> Me.OdbcInsertCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_CLASS",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
> '
> 'OdbcDeleteCommand1
> '
> Me.OdbcDeleteCommand1.CommandText = "DELETE FROM epctag WHERE
> (ID = ?)"
> Me.OdbcDeleteCommand1.Connection = Me.OdbcConnection1
> Me.OdbcDeleteCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
> Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
> '
> 'OdbcUpdateCommand1
> '
> Me.OdbcUpdateCommand1.CommandText = "UPDATE ecptag SET ID = ?,
> OBJECT_EPC = ?, READER_EPC = ?, DATE_TIME = ?, PAYLOAD " & _
> "= ?, GTIN_DOMAIN = ?, GTIN_CLASS = ? WHERE (ID = ?)"
> Me.OdbcUpdateCommand1.Connection = Me.OdbcConnection1
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.BigInt,
> 0, "ID"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("OBJECT_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "OBJECT_EPC"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("READER_EPC",
> System.Data.Odbc.OdbcType.VarChar, 255, "READER_EPC"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("DATE_TIME",
> System.Data.Odbc.OdbcType.VarChar, 255, "DATE_TIME"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("PAYLOAD",
> System.Data.Odbc.OdbcType.VarChar, 255, "PAYLOAD"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_DOMAIN",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_DOMAIN"))
> Me.OdbcUpdateCommand1.Parameters.Add(New
> System.Data.Odbc.OdbcParameter("GTIN_CLASS",
> System.Data.Odbc.OdbcType.VarChar, 255, "GTIN_CLASS"))
> '
> 'Form1
> '
> Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> Me.ClientSize = New System.Drawing.Size(608, 398)
> Me.Controls.Add(Me.btnLoad)
> Me.Controls.Add(Me.btnUpdate)
> Me.Controls.Add(Me.DataGrid1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> CType(Me.DsTags1,
> System.ComponentModel.ISupportInitialize).EndInit()
> CType(Me.DataGrid1,
> System.ComponentModel.ISupportInitialize).EndInit()
> Me.ResumeLayout(False)
> End Sub
> #End Region
> Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles btnUpdate.Click
> OdbcDataAdapter1.Update(DsTags1)
> MessageBox.Show("Database Updated!")
> End Sub
> Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles btnLoad.Click
> OdbcDataAdapter1.Fill(DsTags1)
> MessageBox.Show("Data Table Loaded Successfully!")
> End Sub
> End Class
>
> That's the long and short of it! Appreciate any help.
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!

Sunday, February 26, 2012

Error : Cannot open user default database. Login failed.

I work with Microsoft visual studio 2005.
i get data from a table by ADO.NET :

SqlConnection sqlConn = new SqlConnection(strConnectionString);
sqlConn.Open();
.....

it works fine.

but when i open the SQL Server 2005 express edition and connect to the server (inside the same computer) to check something and then get back to the VS and run the code again ,the Open() function fails with the exception :

{"Cannot open user default database. Login failed.\r\nLogin failed for user 'DOMAIN\\asaf_a'."


disconnecting the server doesn't help and even closing the SQL Server 2005 application doesn't help.
Only restarting the computer enables the Open() command to work again.

Why ?

Every user has a default database specified. If you are using a SQLConnectinstring you are normally redirecting the user within the connectionstring to a specific database (Initial Catalog). By connecting with another tool which does not have the availbility to choose a starting database the user is redirected to its "home" / default database. If the database was dropped in the meantime, or the user was denied access / or even not granted, the login procedure will fail. You can set the user defaults database with using the procedure sp_defaultdb or by using any gui which can administer the logins.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Thanks jens,

i solved the problem.

It was my connection string all along. it was wrong. This was the problem.

I changed the connection string from :

string strConnectionString = @."Server=.\SQLTESTING;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data\TestDB.mdf;Integrated Security=SSPI";

To :

string strConnectionString = @."Server=.\SQLTESTING;Integrated Security=TRUE;Database=TestDB";

now i can use (Open) the TestDB Database from the VS code even when the SQL Server 2005 is also connected to this database.

Thanks!

Wednesday, February 15, 2012

ERREUR to open a data base with SSMSEE

I installed Visual Studio 2005 Standard Edition which contains SQL Server Express.

I downloaded and installed SQL Server Management Studio Express. It run !

I established a connection server BellFixe\SQLEXPRESS (BellFixe is the name of my computer). Ok.

The command " add " of the function " attach " of SSMSE allows to navigate on the disk and to attach diverse data bases but it refuses to open the directory D:\Documents and Settings\Alain (this path is the base of all my directories of data). This directory appears empty. I cannot thus attach the data bases which are under this directory !

I can open a data base only if it is elsewhere localised.

Why this limitation of access and how to resolve this problem? There is certainly a relation with the management of the users of the PC.

I am only user and administrator of my PC under XP. All my directories of data are under D:\Documents and Settings\Alain. The explorer Windows allows to navigate everywhere the disk.

Tanks.

hi,

the position you specfied is not a good one for such a kind of data as it is meant as "private" storage for the current (aka Alain) logged user... you should modify the path to something available to all users, even if SQLExpress always is run under the credential of the account you specified at install time or later, via the Surface Area Configuration or SQL Server Configuration Manager..

regards

|||

But SSMSEE should be able to cross all the disk, in mode administrator. He is not right for such a limitaion there is not it ?

This is only an MSDN exercise "Coatch ASP.NET". But it is blocking for me.

Regards

|||

hi,

AchLog wrote:

But SSMSEE should be able to cross all the disk, in mode administrator. He is not right for such a limitaion there is not it ?

is your SQL Server engine service running under Network Service or Local Service account?

please verify via SQL Server Configuration Manager..

regards

|||

Thank You for your answer Andrea.

SQL Server is local on my machine of development.

I have not yet understood how to verify the connexion mode with SQL Server Configuration Manager. I am a little bit novice with SQL Server and his tools.
Can you tell me how to verify it?

Here method indicated by coach ASP.NET to attach a local data base with SSMSEE. On my computer it is the step 4 which does not function.

===========================================

A simple solution is to attach your data base to your waiter SQL Express. It is now very easy with the console of administration “SQL Server Management Studio Express train” of the final version of SQL Server Express:

1 - to launch the console of administration since the menu To start/All the programs/Microsoft SQL Server 2005/SQL Server Management Studio Express train CTP.

2 - connect to the waiter of name”. \ SQLExpress " via the Windows authentification.

3 - in the explorer of object, made a right click on the file “Databases” then the order “attach”.

4 - find on the disc your file .mdf and add it. Your data base is now attached to SQL Server. You must see it in the list of the data bases of the console.

============================================
Thank you

|||

AchLog wrote:

Thank You for your answer Andrea.

SQL Server is local on my machine of development.

I have not yet understood how to verify the connexion mode with SQL Server Configuration Manager. I am a little bit novice with SQL Server and his tools.
Can you tell me how to verify it?

execute the SQL Server Configuration Manager.. in the SQL Server services locate the SQL Server engine you are dealing with.. right click on it and access it's properties.. you can there see (and set) the account running the services... if you modify it you have to restart the service..

AchLog wrote:

Here method indicated by coach ASP.NET to attach a local data base with SSMSEE. On my computer it is the step 4 which does not function.

===========================================

A simple solution is to attach your data base to your waiter SQL Express. It is now very easy with the console of administration “SQL Server Management Studio Express train” of the final version of SQL Server Express:

1 - to launch the console of administration since the menu To start/All the programs/Microsoft SQL Server 2005/SQL Server Management Studio Express train CTP.

2 - connect to the waiter of name”. \ SQLExpress " via the Windows authentification.

3 - in the explorer of object, made a right click on the file “Databases” then the order “attach”.

4 - find on the disc your file .mdf and add it. Your data base is now attached to SQL Server. You must see it in the list of the data bases of the console.

============================================
Thank you

the "explanation" is correct... this is the "traditional" way to attach a database to a SQL Server instance via SSMS (and SSMSE), but not to "user instances" as the perform differently...

regards

|||

Tank You Andrea,

The parameters are the following ones :

Name : bellfixe\sqlexpress

ERREUR to open a data base with SSMSEE

I installed Visual Studio 2005 Standard Edition which contains SQL Server Express.

I downloaded and installed SQL Server Management Studio Express. It run !

I established a connection server BellFixe\SQLEXPRESS (BellFixe is the name of my computer). Ok.

The command " add " of the function " attach " of SSMSE allows to navigate on the disk and to attach diverse data bases but it refuses to open the directory D:\Documents and Settings\Alain (this path is the base of all my directories of data). This directory appears empty. I cannot thus attach the data bases which are under this directory !

I can open a data base only if it is elsewhere localised.

Why this limitation of access and how to resolve this problem? There is certainly a relation with the management of the users of the PC.

I am only user and administrator of my PC under XP. All my directories of data are under D:\Documents and Settings\Alain. The explorer Windows allows to navigate everywhere the disk.

Tanks.

hi,

the position you specfied is not a good one for such a kind of data as it is meant as "private" storage for the current (aka Alain) logged user... you should modify the path to something available to all users, even if SQLExpress always is run under the credential of the account you specified at install time or later, via the Surface Area Configuration or SQL Server Configuration Manager..

regards

|||

But SSMSEE should be able to cross all the disk, in mode administrator. He is not right for such a limitaion there is not it ?

This is only an MSDN exercise "Coatch ASP.NET". But it is blocking for me.

Regards

|||

hi,

AchLog wrote:

But SSMSEE should be able to cross all the disk, in mode administrator. He is not right for such a limitaion there is not it ?

is your SQL Server engine service running under Network Service or Local Service account?

please verify via SQL Server Configuration Manager..

regards

|||

Thank You for your answer Andrea.

SQL Server is local on my machine of development.

I have not yet understood how to verify the connexion mode with SQL Server Configuration Manager. I am a little bit novice with SQL Server and his tools.
Can you tell me how to verify it?

Here method indicated by coach ASP.NET to attach a local data base with SSMSEE. On my computer it is the step 4 which does not function.

===========================================

A simple solution is to attach your data base to your waiter SQL Express. It is now very easy with the console of administration “SQL Server Management Studio Express train” of the final version of SQL Server Express:

1 - to launch the console of administration since the menu To start/All the programs/Microsoft SQL Server 2005/SQL Server Management Studio Express train CTP.

2 - connect to the waiter of name”. \ SQLExpress " via the Windows authentification.

3 - in the explorer of object, made a right click on the file “Databases” then the order “attach”.

4 - find on the disc your file .mdf and add it. Your data base is now attached to SQL Server. You must see it in the list of the data bases of the console.

============================================
Thank you

|||

AchLog wrote:

Thank You for your answer Andrea.

SQL Server is local on my machine of development.

I have not yet understood how to verify the connexion mode with SQL Server Configuration Manager. I am a little bit novice with SQL Server and his tools.
Can you tell me how to verify it?

execute the SQL Server Configuration Manager.. in the SQL Server services locate the SQL Server engine you are dealing with.. right click on it and access it's properties.. you can there see (and set) the account running the services... if you modify it you have to restart the service..

AchLog wrote:

Here method indicated by coach ASP.NET to attach a local data base with SSMSEE. On my computer it is the step 4 which does not function.

===========================================

A simple solution is to attach your data base to your waiter SQL Express. It is now very easy with the console of administration “SQL Server Management Studio Express train” of the final version of SQL Server Express:

1 - to launch the console of administration since the menu To start/All the programs/Microsoft SQL Server 2005/SQL Server Management Studio Express train CTP.

2 - connect to the waiter of name”. \ SQLExpress " via the Windows authentification.

3 - in the explorer of object, made a right click on the file “Databases” then the order “attach”.

4 - find on the disc your file .mdf and add it. Your data base is now attached to SQL Server. You must see it in the list of the data bases of the console.

============================================
Thank you

the "explanation" is correct... this is the "traditional" way to attach a database to a SQL Server instance via SSMS (and SSMSE), but not to "user instances" as the perform differently...

regards

|||

Tank You Andrea,

The parameters are the following ones :

Name : bellfixe\sqlexpress