P
Petr Studenovsky
Hello
I made small GUI test program in Visual Basic NET for SQL
communication. I need some help with these problems.
problem 1)
If I change some settings in datagrid from
properties window (e.g. background color). my datatest is
removed. I compared it with diff program and it
reorganized all source code.
problem 2)
When I open project in VS.NET 2003, it asks for
some conversion. After this conversion project is not
working any more (Datagrid shows empty results and there
are some other wornigs).
Question 1)
Is it ok to split wizard code this way or is there
another recomendet method
Question 2)
Is it possible that there is some know problem
with project's conversion between VS 1.0 and VS 1.1. Or is
it caused by my code design.
Project uses Datagrid and SQL connection (connector and
dataset). I genarated the connection with data wizard. I
splitted this generated code into two parts. An unvisible
part of the connection is in dll library, it means these
variables and there initialisation.
Public Class iceMain
Public WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As
System.Data.SqlClient.SqlConnection
Public WithEvents DsUzivatele1 As CMain.DsUzivatele
--my init method contains:
Me.DsUzivatele1 = New CMain.DsUzivatele()
Me.SqlDataAdapter1 = New
System.Data.SqlClient.SqlDataAdapter()
Me.SqlDeleteCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New
System.Data.SqlClient.SqlConnection()
Me.SqlInsertCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlSelectCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlUpdateCommand1 = New
System.Data.SqlClient.SqlCommand()
CType(Me.DsUzivatele1,
System.ComponentModel.ISupportInitialize).BeginInit()
'DsUzivatele1
'
Me.DsUzivatele1.DataSetName = "DsUzivatele"
Me.DsUzivatele1.Locale = New
System.Globalization.CultureInfo("de-DE")
Me.DsUzivatele1.Namespace
= "http://www.tempuri.org/DsUzivatele.xsd"
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand =
Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand =
Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand =
Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "uzivatele",
New System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("userID", "userID"),
New System.Data.Common.DataColumnMapping
("uzivatelskeJmeno", "uzivatelskeJmeno"), New
System.Data.Common.DataColumnMapping("heslo", "heslo"),
New
...
A grid control is in test application that use exported
dataset from dll.
....
Me.DataGrid1.DataMember = "uzivatele"
Me.DataGrid1.DataSource = mCman.DsUzivatele1
<======= (removed by wisual editation)
Me.DataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText
....
Thank you
I made small GUI test program in Visual Basic NET for SQL
communication. I need some help with these problems.
problem 1)
If I change some settings in datagrid from
properties window (e.g. background color). my datatest is
removed. I compared it with diff program and it
reorganized all source code.
problem 2)
When I open project in VS.NET 2003, it asks for
some conversion. After this conversion project is not
working any more (Datagrid shows empty results and there
are some other wornigs).
Question 1)
Is it ok to split wizard code this way or is there
another recomendet method
Question 2)
Is it possible that there is some know problem
with project's conversion between VS 1.0 and VS 1.1. Or is
it caused by my code design.
Project uses Datagrid and SQL connection (connector and
dataset). I genarated the connection with data wizard. I
splitted this generated code into two parts. An unvisible
part of the connection is in dll library, it means these
variables and there initialisation.
Public Class iceMain
Public WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As
System.Data.SqlClient.SqlConnection
Public WithEvents DsUzivatele1 As CMain.DsUzivatele
--my init method contains:
Me.DsUzivatele1 = New CMain.DsUzivatele()
Me.SqlDataAdapter1 = New
System.Data.SqlClient.SqlDataAdapter()
Me.SqlDeleteCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New
System.Data.SqlClient.SqlConnection()
Me.SqlInsertCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlSelectCommand1 = New
System.Data.SqlClient.SqlCommand()
Me.SqlUpdateCommand1 = New
System.Data.SqlClient.SqlCommand()
CType(Me.DsUzivatele1,
System.ComponentModel.ISupportInitialize).BeginInit()
'DsUzivatele1
'
Me.DsUzivatele1.DataSetName = "DsUzivatele"
Me.DsUzivatele1.Locale = New
System.Globalization.CultureInfo("de-DE")
Me.DsUzivatele1.Namespace
= "http://www.tempuri.org/DsUzivatele.xsd"
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand =
Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand =
Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand =
Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "uzivatele",
New System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("userID", "userID"),
New System.Data.Common.DataColumnMapping
("uzivatelskeJmeno", "uzivatelskeJmeno"), New
System.Data.Common.DataColumnMapping("heslo", "heslo"),
New
...
A grid control is in test application that use exported
dataset from dll.
....
Me.DataGrid1.DataMember = "uzivatele"
Me.DataGrid1.DataSource = mCman.DsUzivatele1
<======= (removed by wisual editation)
Me.DataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText
....
Thank you