473,404 Members | 2,137 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,404 software developers and data experts.

No data in datagrid column

Hi,

Could anyone help me?

I'm trying to create a datagrid using the following code. It works fine
except the coloum that is supposed to display the entrydate is blank. All
the other information displays correctly.

<%@ Import Namespace="System.Data.SqlClient" %>

<Script Runat="Server">

Sub Page_Load
Dim condb112944995 As SqlConnection
Dim cmdSelect As SqlCommand

condb112944995 = New SqlConnection(
"Server=************************;UID=************; PWD=********;Database=***********"
)
cmdSelect = New SqlCommand( "Select u_id, u_manuscripttitle,
u_manuscriptauthor, u_genre, u_wordcount, u_critiquecount, u_entrydate From
ManuscriptList", condb112944995 )
condb112944995.Open()
dgrdUserList.DataSource = cmdSelect.ExecuteReader()
dgrdUserList.DataBind()
condb112944995.Close()
End Sub

</Script>

I used the following code to create the table on the SQL server.

CREATE TABLE ManuscriptList
(
u_id INT NOT NULL IDENTITY,
u_manuscripttitle VARCHAR( 100 ),
u_manuscriptauthor VARCHAR( 100 ),
u_genre VARCHAR( 100 ),
u_wordcount VARCHAR( 100 ),
u_critiquecount VARCHAR( 100 ),
u_entrydate DATETIME Default getDate()
)
Is the problem something to do with the last line [i.e. u_entrydate DATETIME
Default getDate()] or is it something to do with the ASP.NET code?

Thanks for your time

Paul Evans
Nov 19 '05 #1
1 895
CMA
hi,

you haven't send some sample data in the DB.
if the database don't have a value, the column in the datagrid is blank.
then the problem is in INSERT.

so try to send getdate() from the SQL.

INSERT INTO table1 values ('aaa', 'bbb'.... , getdate())"

hope this helps,
CMA
"Paul Evans" <pa*********@btinternet.com> wrote in message
news:#V**************@tk2msftngp13.phx.gbl...
Hi,

Could anyone help me?

I'm trying to create a datagrid using the following code. It works fine
except the coloum that is supposed to display the entrydate is blank. All the other information displays correctly.

<%@ Import Namespace="System.Data.SqlClient" %>

<Script Runat="Server">

Sub Page_Load
Dim condb112944995 As SqlConnection
Dim cmdSelect As SqlCommand

condb112944995 = New SqlConnection(
"Server=************************;UID=************; PWD=********;Database=****
*******" )
cmdSelect = New SqlCommand( "Select u_id, u_manuscripttitle,
u_manuscriptauthor, u_genre, u_wordcount, u_critiquecount, u_entrydate From ManuscriptList", condb112944995 )
condb112944995.Open()
dgrdUserList.DataSource = cmdSelect.ExecuteReader()
dgrdUserList.DataBind()
condb112944995.Close()
End Sub

</Script>

I used the following code to create the table on the SQL server.

CREATE TABLE ManuscriptList
(
u_id INT NOT NULL IDENTITY,
u_manuscripttitle VARCHAR( 100 ),
u_manuscriptauthor VARCHAR( 100 ),
u_genre VARCHAR( 100 ),
u_wordcount VARCHAR( 100 ),
u_critiquecount VARCHAR( 100 ),
u_entrydate DATETIME Default getDate()
)
Is the problem something to do with the last line [i.e. u_entrydate DATETIME Default getDate()] or is it something to do with the ASP.NET code?

Thanks for your time

Paul Evans

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob Rosen | last post by:
The description given in "Customizing Items Dynamically in the DataList or DataGrid Web Server Control" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbCode/...
5
by: Dave | last post by:
Hi all, Apologies if this is the wrong group. I have done a search on google but my keywords are probably no good. What I want to do is to display a list of data in a datagrid (which I have...
2
by: sunstarwu | last post by:
Hi, I am having difficultly being able to view certain Columns and rows via a DropDownList. Everytime I load my webpage.aspx it just shows empty drop down menus. I have no problem showing all...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
1
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so...
2
by: Joe Au | last post by:
I follow the Walkthrough documented on Visual Studio to create an editable data grid but it does not work on getting the value of the textbox in the data grid. The code is copied here. I mark...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.