Hey everyone,

New to the forums, as this will be my first post.

Im having a problem with a tableadapter/tableadapter query.
My query is:

SELECT * FROM subject_assessments
WHERE (sa_id = @sa_id)

sa_id is a varchar, if that is relevant in any way.

My table adapters then look like this:

datasetTableAdapters.Subject_AssessmentsTableAdapter table = new datasetTableAdapters.Subject_AssessmentsTableAdapter();
        dataset.Subject_AssessmentsDataTable assessTable = table.GetDataBy4(cbAssess.SelectedItem.Text);
        dataset.Subject_AssessmentsRow row = (dataset.Subject_AssessmentsRow)assessTable.Rows[0];

The problem is I keep receiving an error saying "Input string was not in a correct format."

Is there something obvious im missing? Or does anyone have any light to shed on my situation?

Thanks,
dAve

try this

dim dt as new datatable("tableName")
dim da as new sqldataadaper("select ur criteria here","urConnection")
da.fill(dt)
for dim i as int=0 to dt.rows.count-1
{
string Tmp =dt(i).value.tostring()
}

i guess this is what i understood from ur code and u will retrieve data on particular index

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.