Click here to Skip to main content
13,142,065 members (56,748 online)
Rate this:
Please Sign up or sign in to vote.
See more:
SqlDataAdapter dmt = new SqlDataAdapter("select * from PartsInfoRetreive('" + this.comboBoxDesc.SelectedValue + "')", con);
DataSet smt = new DataSet();
dmt.Fill(smt, "qty");
DataView vmkt = new DataView(smk.Tables["qty"]);
txtIdentifica.Text = vmkt[0]["description"].ToString();
txtPartNo.Text = vmkt[1]["description"].ToString();
txtMark.Text = vmkt[2]["description"].ToString();
txtModel.Text = vmkt[3]["description"].ToString();
txtQuality.Text = vmkt[4]["description"].ToString();
Posted 10-Oct-12 1:30am
Updated 10-Oct-12 2:18am
biswarup88 10-Oct-12 7:48am
write your code inside try catch block so that you can handle this type of exception.
Richard MacCutchan 10-Oct-12 7:53am
You should check the return code(s) from your method calls to see whether they succeeded, and if so, how many items were returned.
ryanb31 10-Oct-12 8:19am
Check your row count first.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

DataView vmkt = new DataView(smk.Tables["qty"]);

check the dataset name instead of smt u wrote smk thats the error

DataView vmkt = new DataView(smt.Tables["qty"]);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100