Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

namespace WebApplication1
{
    public partial class About : System.Web.UI.Page
    {
        string connstr = (@"server=KANHA-PC;database=asp1;integrated security=true;");
        public void grid_fill()
        {
            SqlConnection con = new SqlConnection(connstr);
            SqlDataAdapter da = new SqlDataAdapter("select * from asp", con);
            dataset ds = new dataset();
            da.Fill(ds);
            GridView1.DataSource = ds;
            GridView1.DataBind(); 
            con.Close();
            }

its showing erroe:-

Error 1 The type or namespace name 'dataset' could not be found (are you missing a using directive or an assembly reference?) c:\users\kanha\documents\visual studio 2010\projects\WebApplication1\WebApplication1\About.aspx.cs 18 13 WebApplication1

Error 2 The type or namespace name 'dataset' could not be found (are you missing a using directive or an assembly reference?) c:\users\kanha\documents\visual studio 2010\projects\WebApplication1\WebApplication1\About.aspx.cs 18 30 WebApplication1

anuone can suggest me what is the problem in my visual studio 2010.

thanx in advance
Rakesh Sharma
Posted
Updated 5-Aug-11 23:36pm
v2

1 solution

Dear Mr. Rakesh,

1. You suppose to use System.Data in your program.
2. DataSet is the class name and C# is case sensitive

Hope that will resolve your problem
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900