473,386 Members | 1,766 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.

An invalid data source is being used for DataGrid. A valid data source must implement

I am doing our final project and I find difficult to finish this.
would you please help me with this?

here is the code:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An invalid data source is being used for DataGrid. A valid data source must implement either IListSource or IEnumerable.

Source Error:


Expand|Select|Wrap|Line Numbers
  1. Line 142:        JHCSCPAGADIANSTUDENT.Close()
  2. Line 143:
  3. Line 144:        DataGrid.DataSource = DataGrid
  4. Line 145:        FillMessageTable()
  5. Line 146:
Source File: C:\Users\Sweetheart cuh\Documents\samplee\StudProfile\StudProfile\Defa ult.aspx.vb Line: 144

Stack Trace:


[ArgumentException: An invalid data source is being used for DataGrid. A valid data source must implement either IListSource or IEnumerable.]
System.Web.UI.WebControls.BaseDataList.set_DataSou rce(Object value) +8684978
StudProfile._Default.btnsave_Click(Object sender, EventArgs e) in C:\Users\Sweetheart cuh\Documents\samplee\StudProfile\StudProfile\Defa ult.aspx.vb:144
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Mar 17 '13 #1
1 2811
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

On line 144, you're assigning a data grid to the data source. You need to assign a data source to the data source.
Mar 18 '13 #2

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

Similar topics

3
by: NickName | last post by:
Here's the situation, developers inherit a web app from someone, backend SQL db has about 120 user tables and the db is also being used by other apps. Developers don't have a list of user tables...
4
by: Dan | last post by:
I'm trying to creat a data structure, that can be either a integer, double, string, or linked list. So I created the following, but don't know if it is the data structure itself causing problems,...
5
by: Mikael Syska | last post by:
Hi, I have 2 talbes in a DataSet, and made a DataRelation between the 2 tables in the DataSet. One of the Tables are displayed in a datagrid, and when one of them is selected in the datagrid...
0
by: Bret Pehrson | last post by:
I'm using a custom data source for my (WinForms) datagrid: public class MyDataSource : IList { // ... } each row is a: public class MyDataRow
4
by: John Dalberg | last post by:
I have a weird problem. I have a webpage that displays a datagrid with data but when I use IE to view the html representation, the source has no table source for the datagrid. I used Opera, Mozilla...
1
by: Stephen Adam | last post by:
Hi there, I have written a custom validation control which checks to see of an input field is not empty and contains only numeric data. I was using a regular expression validation control but...
3
by: anand | last post by:
hi, let: dataSet1 is having some data from database. dataView1 = dataSet1.table(0).defaultView dataGrid1.dataSource = dataView1 dataGrid1.TableStyle.add(myTableStyle1)
1
by: Adrian Turner | last post by:
I am just starting developing with .Net(Have used asp for years). I have created a very simple upload page which once uploaded opens the file(excel) and displays the data. If I Attempt to re-run...
1
by: 22dude | last post by:
it says the variable hours is being used with out being initializes i am using C++ 2005 express edition , I am currently student Please help me out to find the solution on my code below #...
4
by: Bob Thompson | last post by:
I've tried everything and nothing works. I'm connecting to a Microsoft Access database using the following code: OleDbConnection conn = new OleDbConnection( @"Provider=Microsoft.Jet.OLEDB.4.0;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.