filling listbox from table

C

cj

This used to work a year ago when I wrote it using SQL Express 2005 on
my pc but I've created the database and tables on our production SQL
Sever 2000 and it doesn't work

What's listed in the listbox is a repeated System.Data.DataRowView

It's been so long since I worked on this and I really don't understand
why it used to work and now doesn't. Of course I had to change the
connection string but that's the only change I made to the code. I
think I got the tables and indexes created on SQL Sever 2000 just like
they were in SQL Express 2005.


KeyWTableDeleteCmd.Connection = HitsDbConn
KeyWTableDeleteCmd.CommandText = "DELETE FROM KeyWordTable
WHERE id = @id"
With KeyWTableDeleteCmd.Parameters
.Add("@id", SqlDbType.Int, 4, "id")
End With
KeyWTableDAdapter.DeleteCommand = KeyWTableDeleteCmd

AllowDataGridUpdate = False
REM read/sort key words
KeyWTableDAdapter.Fill(KeyDs, "KeyWordTable")
KeyDs.Tables("KeyWordTable").DefaultView.Sort = "KeyWord"

REM add keywords to listbox
KeyListBox.DataSource() = KeyDs.Tables("KeyWordTable")
KeyListBox.DisplayMember = "KeyWord"
AllowDataGridUpdate = True
 
C

cj

never mind. I missed capitalizing a letter in the field name of the new
database. It's fixed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top