473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

System.IndexOutOfRangeException: Cannot find table 0.

ramanan ram
hi..

here,i am getting
System.IndexOutOfRangeException: Cannot find table 0.this
error.

coding:
Expand|Select|Wrap|Line Numbers
  1.  OleDbConnection conn1 = new OleDbConnection(conn);
  2.             conn1.Open();
  3.             string sql = "SAMPLEPROCEDURE";
  4.             OleDbCommand dbcomm = new OleDbCommand(sql, conn1);
  5.             dbcomm.CommandType = CommandType.StoredProcedure;
  6.             dbcomm.Parameters.Add("P_SUPPVALUE", OleDbType.VarChar, 200).Value = suppvalue.Text;
  7.             OleDbDataAdapter ole = new OleDbDataAdapter(dbcomm);
  8.             DataSet ds1 = new DataSet();
  9.             ole.Fill(ds1);
  10.             string value = ds1.Tables[0].Rows[0]["a"].ToString();
  11.  
last line affect this program ,now i need a value to be store the variable of value.a is an stored procedure table field using...
please help..
Apr 4 '12 #1

✓ answered by Frinavale

Your fill didn't retrieve any data, so there is no table at that index.

Make sure that your query and connections are correct.

-Frinny

1 10700
Frinavale
9,735 Expert Mod 8TB
Your fill didn't retrieve any data, so there is no table at that index.

Make sure that your query and connections are correct.

-Frinny
Apr 4 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: MLH | last post by:
The Microsoft Jt database engine can not find tblJobSites, error #3078. That's what I get when executing this code... Private Sub Command1_Click() Dim MyWorkspace As Workspace Set MyWorkspace...
0
by: Juan Galdeano | last post by:
Hi, I'm working on an ONIX project and when I try to validate or read XML files C# gives me this exception: System.IndexOutOfRangeException at System.Xml.XmlScanner.ScanDtdContent() at...
0
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
1
by: Ratman | last post by:
I have the following code... Public Sub SelectPieceByProductID() Try Dim arParams(0) As SqlParameter arParams(0) = New SqlParameter("@lProductID", lProductID)
3
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection...
2
by: | last post by:
Using the following against a sql database, I get a system.IndexOutOfRangeException for the column name Add_Date which is valid field name and is a datetime field. All the other columns work ok. ...
1
by: Robert Batt | last post by:
Hello, I have a problem deleting from a datagrid bound to a dataset. then datagrid is bound as follows MyDatagrid.DataSource = Mydataset.Tables(strtable this works fine for adding and...
1
by: blondsecret | last post by:
Hello everyone, after installing a Strokes 'easylearning' CD-Rom, following dialogue is shown to me: Microsoft .NET Framework An unhandled exception has occurred in a component in your...
2
by: dowlingm815 | last post by:
I am attempting to create a table with an index. however, i am receiving an error code "3371: Cannot find table or constraint" as soon as it reads the "create index" statement. The code is as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.