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

Problem populating dropdownlist control

Hi
I am unable to puoplate my dropdownlist control witht he correct data. I am tying to load the dates from a column in sql server via a stored proc. The date is appearing as 12/01/2001 12:00 am. I want it to be 12/01/2004. I used the convert function in sql server but i get an error loading the page. If I don't use the convert function the page loads but with the date as 12/01/2001 12:00 am

This is my S

create procedure sevenIssues
@productName varchar(50)

a

declare @productNumber varchar(10

exec POS_GetProductNumber @productName, @productNumber OUTPU

select Cover_Date from global_sales wher
Product_Number = @productNumbe

return
Nov 18 '05 #1
1 939
Unless you are using Strongly Typed Datasets, you should be able to do
something like:

select CAST(Cover_Date AS VARCHAR(11)) from global_sales where
Product_Number = @productNumber

Not sure how you were using CONVERT(), but it should work, as well without
strongly typed DataSets.

What error are you getting.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"CHRIS" <an*******@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
Hi,
I am unable to puoplate my dropdownlist control witht he correct data. I am tying to load the dates from a column in sql server via a stored proc.
The date is appearing as 12/01/2001 12:00 am. I want it to be 12/01/2004. I
used the convert function in sql server but i get an error loading the page.
If I don't use the convert function the page loads but with the date as
12/01/2001 12:00 am.
This is my SP
create procedure sevenIssues(
@productName varchar(50))

as
declare @productNumber varchar(10)
exec POS_GetProductNumber @productName, @productNumber OUTPUT
select Cover_Date from global_sales where
Product_Number = @productNumber
return

Nov 18 '05 #2

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

Similar topics

1
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList...
0
by: Kalyani | last post by:
Hi, I have a page with one DropDownList and a Placeholder.This placeholder wil contain either a textbox or a DropDownList depending upon the value in previous DropDownList. Also there is a Submit...
1
by: CHRIS | last post by:
Hi I am unable to puoplate my dropdownlist control witht he correct data. I am tying to load the dates from a column in sql server via a stored proc. The date is appearing as 12/01/2001 12:00 am. I...
7
by: Xarky | last post by:
Hi, I am using a DropDownList and populating with items. One of the items is set as blank(""). I need to check that the items selected from this DropDownList is not that value but another one....
1
by: Kalyani | last post by:
Hi, I have a page with one DropDownList and a Placeholder.This placeholder wil contain either a textbox or a DropDownList depending upon the value in previous DropDownList. Also there is a Submit...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: ana_gil | last post by:
hello i have a problem with a dropdown list i am populating from an Access table. I´ve seen this problem in other discussions but i can´t seem to find the solution. please help. my .aspx has...
1
by: Problematic coder | last post by:
Here is the main code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load buildYearDDLs(FindControl("ddlSample")) End sub Private Sub...
1
by: Mike | last post by:
Hi I am using predefined membership and roles managemant approach characteristic for framework 2.0 Basic idea is that we select some value from DropDownList which represents a role and we get...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.