Click here to Skip to main content
12,500,761 members (45,378 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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
v2
Comments
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
 
good
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"]);
  Permalink  
v2

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 | Mobile
Web01 | 2.8.160919.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2016
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