Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am able to fecth the values from tha sql server database using code like this

public class MyCustomDataSource
    {
        private List<Employee> _employee = new List<Employee>();
        public IQueryable<Employee> employee { get { return _employee.AsQueryable(); } }
        string ConnectionString = "Data Source=(local);Initial Catalog=Employee;Integrated Security=True";
        public SqlConnection Con = null;
        public MyCustomDataSource()
        {
            GetData();
        }
        public void GetData()
        {
            Con = new SqlConnection(ConnectionString);
            Con.Open();
            string str = "select * from Employee";
            SqlCommand Cmd = new SqlCommand(str, Con);
            SqlDataReader sqlDataReader = Cmd.ExecuteReader();
            while (sqlDataReader.Read())
            {
                Employee emp = new Employee();
                emp.id = sqlDataReader.GetInt32(0);
                emp.name = sqlDataReader.GetString(1);
                _employee.Add(emp);
            }
        }
    }


similarly in my company they have been store the data in the mainframe so any one knows the code to fetch that data and returning data should be iqueryable so please any one help me

hi anyone please help me on this question
Posted
Updated 1-May-11 21:52pm
v3

1 solution

This is still your second question: if you want to give extra information, use the "Improve question" widget at the end of the question, and add the info.

Do not just create a new question - it is unnecessary and can get you abuse rather than answers.
 
Share this answer
 
Comments
MURARI00 27-Apr-11 7:00am    
thank u

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