473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can't I set properties at design time

Hi
I have a combobox wich I set the Datasource,Displaymember and Valuemember at
design time. I'm using a Dataset's table. But when I run the form the
combobox isn't filled. Can't I set properties at design time

This is the code for the sub InitializeComponent()

<System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()
Me.OleDbDADVD = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnDVD = New System.Data.OleDb.OleDbConnection
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
Me.txtNamn = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.cmbKategori = New System.Windows.Forms.ComboBox
Me.DSKat = New DVDVideo.DataSet1
Me.Label2 = New System.Windows.Forms.Label
Me.OleDbDAKat = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbDeleteCommand2 = New System.Data.OleDb.OleDbCommand
Me.OleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand
Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand2 = New System.Data.OleDb.OleDbCommand
CType(Me.DSKat, System.ComponentModel.ISupportInitialize).BeginIni t()
Me.SuspendLayout()
'
'OleDbDADVD
'
Me.OleDbDADVD.DeleteCommand = Me.OleDbDeleteCommand1
Me.OleDbDADVD.InsertCommand = Me.OleDbInsertCommand1
Me.OleDbDADVD.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDADVD.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "Film", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("Nr", "Nr"), New
System.Data.Common.DataColumnMapping("Titel", "Titel")})})
Me.OleDbDADVD.UpdateCommand = Me.OleDbUpdateCommand1
'
'OleDbDeleteCommand1
'
Me.OleDbDeleteCommand1.CommandText = "DELETE FROM Film WHERE (Nr = ?) AND
(Titel = ?)"
Me.OleDbDeleteCommand1.Connection = Me.OleDbConnDVD
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nr",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Nr", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Titel",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Titel", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbConnDVD
'
Me.OleDbConnDVD.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data
Source=""C:\Data\Programmering\VB-programmering\Databas\Access" & _
"prog\DVDVideo\DVDVideo\DVDVideo\DVDVideo.mdb"";Mo de=Share Deny None;Jet
OLEDB:Eng" & _
"ine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System
database=;Jet OLE" & _
"DB:SFP=False;persist security info=False;Extended Properties=;Jet
OLEDB:Compact " & _
"Without Replica Repair=False;Jet OLEDB:Encrypt Database=False;Jet
OLEDB:Create S" & _
"ystem Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;User
ID=Admin;" & _
"Jet OLEDB:Global Bulk Transactions=1"
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO Film(Nr, Titel) VALUES (?,
?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnDVD
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Nr", System.Data.OleDb.OleDbType.Integer,
0, "Nr"))
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Titel",
System.Data.OleDb.OleDbType.VarWChar, 50, "Titel"))
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT Film.Nr, Film.Titel FROM ((Film
INNER JOIN FilmKategori ON Film.Nr = FilmK" & _
"ategori.Nr) INNER JOIN Kategori ON FilmKategori.KategoriID =
Kategori.KategoriID" & _
")"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnDVD
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE Film SET Nr = ?, Titel = ?
WHERE (Nr = ?) AND (Titel = ?)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnDVD
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Nr", System.Data.OleDb.OleDbType.Integer,
0, "Nr"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Titel",
System.Data.OleDb.OleDbType.VarWChar, 50, "Titel"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nr",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Nr", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Titel",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Titel", System.Data.DataRowVersion.Original, Nothing))
'
'txtNamn
'
Me.txtNamn.Location = New System.Drawing.Point(96, 96)
Me.txtNamn.Name = "txtNamn"
Me.txtNamn.Size = New System.Drawing.Size(176, 20)
Me.txtNamn.TabIndex = 0
Me.txtNamn.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 96)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(72, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Titel"
'
'DSKat
'
Me.DSKat.DataSetName = "DSKat"
Me.DSKat.Locale = New System.Globalization.CultureInfo("sv-SE")
'cmbKategori
'
Me.cmbKategori.DataBindings.Add(New
System.Windows.Forms.Binding("SelectedItem", Me.DSKat, "Kategori.Kategori"))
Me.cmbKategori.DisplayMember = "Kategori"
Me.cmbKategori.ValueMember = "KategoriID"
Me.cmbKategori.DataSource = Me.DSKat.Kategori
Me.cmbKategori.Location = New System.Drawing.Point(96, 128)
Me.cmbKategori.Name = "cmbKategori"
Me.cmbKategori.Size = New System.Drawing.Size(176, 21)
Me.cmbKategori.TabIndex = 2
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 128)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(72, 16)
Me.Label2.TabIndex = 3
Me.Label2.Text = "Kategori"
'
'OleDbDAKat
'
Me.OleDbDAKat.DeleteCommand = Me.OleDbDeleteCommand2
Me.OleDbDAKat.InsertCommand = Me.OleDbInsertCommand2
Me.OleDbDAKat.SelectCommand = Me.OleDbSelectCommand2
Me.OleDbDAKat.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "Kategori", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("Kategori", "Kategori"), New
System.Data.Common.DataColumnMapping("KategoriID", "KategoriID")})})
Me.OleDbDAKat.UpdateCommand = Me.OleDbUpdateCommand2
'
'OleDbDeleteCommand2
'
Me.OleDbDeleteCommand2.CommandText = "DELETE FROM Kategori WHERE (KategoriID
= ?) AND (Kategori = ? OR ? IS NULL AND Ka" & _
"tegori IS NULL)"
Me.OleDbDeleteCommand2.Connection = Me.OleDbConnDVD
Me.OleDbDeleteCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor iID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"KategoriID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor i",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Kategori", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor i1",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Kategori", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbInsertCommand2
'
Me.OleDbInsertCommand2.CommandText = "INSERT INTO Kategori(Kategori,
KategoriID) VALUES (?, ?)"
Me.OleDbInsertCommand2.Connection = Me.OleDbConnDVD
Me.OleDbInsertCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Kategori",
System.Data.OleDb.OleDbType.VarWChar, 50, "Kategori"))
Me.OleDbInsertCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("KategoriID",
System.Data.OleDb.OleDbType.Integer, 0, "KategoriID"))
'
'OleDbSelectCommand2
'
Me.OleDbSelectCommand2.CommandText = "SELECT Kategori, KategoriID FROM
Kategori"
Me.OleDbSelectCommand2.Connection = Me.OleDbConnDVD
'
'OleDbUpdateCommand2
'
Me.OleDbUpdateCommand2.CommandText = "UPDATE Kategori SET Kategori = ?,
KategoriID = ? WHERE (KategoriID = ?) AND (Kate" & _
"gori = ? OR ? IS NULL AND Kategori IS NULL)"
Me.OleDbUpdateCommand2.Connection = Me.OleDbConnDVD
Me.OleDbUpdateCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Kategori",
System.Data.OleDb.OleDbType.VarWChar, 50, "Kategori"))
Me.OleDbUpdateCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("KategoriID",
System.Data.OleDb.OleDbType.Integer, 0, "KategoriID"))
Me.OleDbUpdateCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor iID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"KategoriID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor i",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Kategori", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand2.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Kategor i1",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Kategori", System.Data.DataRowVersion.Original, Nothing))
'
'frmLäggTill
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(384, 333)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.cmbKategori)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtNamn)
Me.Name = "frmLäggTill"
Me.Text = "DVD "
CType(Me.DSKat, System.ComponentModel.ISupportInitialize).EndInit( )
Me.ResumeLayout(False)
End Sub

Thanks Fia
Feb 11 '07 #1
0 1263

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark Ramey | last post by:
I have an assembly that I want to license to developers. I don't want to license the runtimes that they deliver to their customers. There are no real design-time controls, only some classes that...
0
by: scpedicini | last post by:
Okay, I've been having a problem with custom design-time properties that has been driving me nuts for about a week. The control that I'm working on extends System.Windows.Forms.AxHost, but I'm...
0
by: Edward Diener | last post by:
In Borland's VCL it was possible to divide a component into design time and run time DLLs. The design time DLL would only be necessary when the programmer was setting a component's properties or...
5
by: Barry Carr | last post by:
Hi, I've created a composite custom web control and a ControlDesigner descendant to render the control a design time. The child controls are public properties of composite control and as such...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
3
by: cleo | last post by:
In VB6 my practice was to set control properties at Run Time rather than Design Time. I found setting property values in the code provided better documentation, since much of this was hidden - and...
2
by: Miky | last post by:
Hi, I'm looking resources or tutorial where I can learn how to add properties to other objects at design time for VB.NEt or C#. I want to reproduce the same effect as when your drop the...
6
by: Brett Romero | last post by:
How can I add design-time support to a custom control in VS.NET 2005? Thanks, Brett
1
by: David Veeneman | last post by:
I'm backporting a component to .NET 1.x, and it required me to use a custom collection, StringList, instead of List<string>. StringList is derived from CollectionBase and is marked serializable. ...
2
by: Marcos Stabel | last post by:
I there any way to insert a comment in a function that we can see in design time, at the same tooltip that apear the parameters of the function. tia Marcos
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.