Click here to Skip to main content
Rate this: bad
good
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 2:30am
Edited 10-Oct-12 3:18am
v2
Comments
biswarup88 at 10-Oct-12 7:48am
   
write your code inside try catch block so that you can handle this type of exception.
Richard MacCutchan at 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 at 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
0 Sergey Alexandrovich Kryukov 8,478
1 OriginalGriff 6,516
2 Peter Leow 3,567
3 Zoltán Zörgő 3,386
4 Richard MacCutchan 2,397


Advertise | Privacy | Mobile
Web04 | 2.8.150123.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2015
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