
May 16th, 2003, 03:35 AM
|
|
Registered User
|
|
Join Date: Mar 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Filling a Dataset
An exception is thrown when filling my data set. I thought I read something in the a while back (can't find it now) that mentioned you had to do something "special" when querying using a primary key.... I may be wrong. Anyway here is my snipplet:<br><br><br>//au_id is a primary key<br>sqlDataAdapter1.SelectCommand.CommandText = "Select * from authors where au_id=" + dpdlist.SelectedItem.Value;<br>dsinfo1.Clear();<br>sqlDataAdapter1.Fill(dsinfo1); // exception is thrown here:Syntax error converting the <br> // varchar value '172-32-1176' to a column of data type int<br> //172-32-1176 is the value selected from the dropdownlist<br><br><br>Any help is appreciated.
|