Thread View: be.comp.programming
1 messages
1 total messages
Started by verkie
Thu, 29 Aug 2002 16:26
Database connectie
Author: verkie
Date: Thu, 29 Aug 2002 16:26
Date: Thu, 29 Aug 2002 16:26
29 lines
1925 bytes
1925 bytes
Ben hier bezig in .NET en de bedoeling is een combobox op te vullen door
data te halen uit een SQL server 2000 database. Hierbij krijg ik telkens
een error (http://users.pandora.be/nT-TrusT/sqlerror.jpg). Weet iemand hoe
ik dit oplos?
De code in C#:
private void FillUpCategorie()
{
try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Products", "Data
Source=localhost;Initial Catalog=Products;
User ID=Administrator;Password=*******");
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.Fill(dataSet, "Categorie");
cboTrack.DataSource = dataSet.Tables["Categorie"].DefaultView;
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message, "SQL error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
--
mvgr,
verkie
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads