hi. I am trying to write a "simple"program to access and edit data from an access database. trying to get the data to display from a combobox selection to an unbound datagrid. when I run the program I get the error and the explanation "Not allowed to change the 'ConnectionString' property. The connection's current state is open."
below is the code I am using and on my form I have the datagrid "dgMaleLeague" and combobox "cbMaleName"
hope somebody knows of a simple solution I am very much a beginner.
Thanks
Public
conMDB.ConnectionString = _
cmdMDB.Connection = conMDB
cmdMDB.CommandText =
cmdMDB.CommandType = CommandType.Text
conMDB.Open()
rdrMDB = cmdMDB.ExecuteReader
cbMaleName.Items.Add(rdrMDB(
cbMaleName.SelectedIndex = 0
rdrMDB.Close()
conMDB.Close()
cmdMDB.CommandType = CommandType.StoredProcedure
cmdMDB.Parameters.Add(
cmdMDB.Parameters.Item(
adapter.SelectCommand = cmdMDB
adapter.Fill(table)
dgMaleLeague.DataSource = table
table.Tables(0).TableName =
dgMaleLeague.DataMember =
.Columns(0).Width = 100
.Columns(1).Width = 100
.Columns(2).Width = dgMaleLeague.Width - 204
loadMaleLeague()
End