473,378 Members | 1,549 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,378 software developers and data experts.

GridView control in asp.net

7
Hi,

I have a question to ask regarding the gridview control in visual basic 2008.

How to bound data to the gridview control?
I tried to link the gridview to the sqlsourcedata but after linking, I realised that the words in the rows and columns (not including the header) showed me 'abc' instead of 'databound'. This abc means that I did not link my gridview to the sqlsourcedata properly? I don't know...

And, how to ensure that when I update a blog entry, the blog entry data would be displayed in the specified gridview column?

P/S: I'm doing a blogger using asp.net which allows user to update blog entries etc.

Please help, this is urgent.
Thanks.
Jan 5 '09 #1
6 2502
ahling
7
Ohya, this updating of data into the gridview doesnt mean I physically add information into the specified column in the gridview. I suppose you all know how a blog works? When the user typed in the blog entry into the textfield, when they click update, it will automatically update the data into the gridview. That's what I want =)
Jan 5 '09 #2
shweta123
692 Expert 512MB
Hi,

You can write the following code in order to bind the database table to the gridview:

Expand|Select|Wrap|Line Numbers
  1.        //give here the name of data source object in order to 
  2. //bind to gridview
  3.  
  4.                   //Because we have set the datasource property make  'AutoGenerateColumns' property false 
  5.                   gridview1.AutoGenerateColumns = false
  6.                  gridview1.Datasource = sqldatasource
  7.                  gridview1.DataBind()
  8.  

Hope this is what you want.
Jan 5 '09 #3
Frinavale
9,735 Expert Mod 8TB
@ahling
"ABC" must be a column name or property name that your data source contains.
Since the GridView is auto-generating the columns for you based on your data source you are seeing ABC as a header.
Jan 5 '09 #4
ahling
7
@shweta123
Hmm thanks.
But it is not necessary we write codes to bind the database to the gridview?
Can we just link the gridview to the database?

And, my gridview doesn't appear when I view it in browser... How to solve it?

Thanks.
Jan 7 '09 #5
ahling
7
@Frinavale
Oh, I see. Thanks :)
Jan 7 '09 #6
shweta123
692 Expert 512MB
Hi,

Please refer the following link regarding the error that you are getting :
Grid view control in ASP .Net 2.0
Jan 8 '09 #7

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

Similar topics

3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
3
by: chelsea | last post by:
I am using a GridView control with a ButtonField and receiving 2 row command events for each click of the button. Is there a configuration switch that I can turn that will ensure I only receive...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
1
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my...
1
by: spitapps | last post by:
In a traditional gridview control the items inserted(bind) into the control are rows and the data is in columns. I have a customer who wants the data fields as rows and the columns as the items...
1
by: Axeman | last post by:
I have an AJAX enabled web form with several data-filled GridView controls. The users accessing this web app will navigate the site via touch-screen monitors (i.e.: no mouse). As a result, I need...
1
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Hi folks, A web form has a DropDownList control and GridView control. Both are data binding. I expect that selecting an item in the DrowDownList will update the GridView visually. But, extra step...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a gridview control with a template column that has a textbox and when the control is bound to the datasource the textbox is filled ok. I then change what is in the textbox in the gridview...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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:
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
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: 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...

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.