C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Not solved yet my DataGrid Problem?


Posted Date: 19 Nov 2008      Posted By: Reddy      Member Level: Gold     Points: 1   Responses: 1




hi ,

im using .net framework 1.1(2003 version).
i took new webform and in that i placed one datagrid. i'm getting the data to datagrid.
if i unchecked the "Create Columns automatically at run time" and i choose columns->Bound Column. i add Five Bound Columns as my requirement is like that. now im NOT GETTING data to datagrid.?? It is simply showing the Header text values (like EmployeeID Employee Name Employee Email etc..) without data.

coming to my coding part

im using vb.net coding for my web application.

1. <appSettings>
<add key="constring" value="server=SILCP0210;user id=sa;password=;database=ram;"/>
</appSettings>

2. Dim con As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("constring"))

3.In Page load even
If Not IsPostBack Then
BindData()
End If


4.
Public Sub BindData()
con.Open()
Dim cmd As New SqlCommand("SP_SELECT_PERSONS", con)
cmd.CommandType = CommandType.StoredProcedure
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "employee")
cmd.ExecuteNonQuery()
dgEmployees.DataSource = ds
dgEmployees.DataBind()
con.Close()
End Sub


please tell me the solution.


Thanks in advance
reddy.sankar1983@gmail.com





Responses

Author: Pavan Ravi    19 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

after adding the boundcolumn, you have to fill it's datafield property. (with any of the column name in dataTable) ...

Regards,
Pavan Ravi Kumar.

"Complex problems have simple, easy to understand wrong answers."
Ravi's Blog



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : smart client
Previous : panel control in vb.net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use