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

database connection between asp.net and sql server 2005

database connection between asp.net and sql server 2005
--------------------------------------------------------------------------------

I am new to Visual Studio 2005 and SQL Server 2005.

I have a question of database connection between these two.

My code is below:

In index.aspx:

<aspropDownList ID="cbopobcountry" runat="server" Width="160px" DataSourceID="Country" ></aspropDownList>
<asp:SqlDataSource ID="Country" runat="server"
SelectCommand="SELECT DISTINCT [code], [name] FROM [REF_COUNTRY]
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>">
</asp:SqlDataSource>



in Web.config:

<connectionStrings>
<add name="ForteHRMSConnectionString"
connectionString="Data Source=FIPNHITD08\SQLEXPRESS;Initial Catalog=ForteHRMS;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>


My question is that when i run this page it always show system.data.datarowview in my dropdownlist.

How can I solve this problem?

Please reply me as soon as possible.
Oct 1 '07 #1
2 1182
jhardman
3,406 Expert 2GB
moved to .NET forum
Oct 2 '07 #2
Shashi Sadasivan
1,435 Expert 1GB
that is because you are assigning the entire object to your list.

you will have to break it up and explicitly mention the field name you want to add to your drop down list.

It does not seem to be the fault of your connection string

cheers
Oct 2 '07 #3

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

Similar topics

12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
0
by: Hongbo | last post by:
Hi, I have a test server with Windows 2003 Standard Server. SQL Server 2000 Standard Edition was installed earlier as default instance. My ASP.Net web site works fine with the connection...
3
by: jason | last post by:
I've been playing around with new (for 2.0) membershp functionality. I was able to build a simple login form that secures a directory on a project I built locally on my development desktop. ...
0
by: Jonathan Wood | last post by:
I seem to be having errors creating and accessing an SQL database. Unfortunatley, I am brand new to SQL setup and administration issues so this really is not my area of expertise. I know I had...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
5
by: igotyourdotnet | last post by:
I'm trying to add a web part to my page and when I run my page with the web part I get this error: An error has occurred while establishing a connection to the server. When connecting to SQL...
2
by: Patrick F | last post by:
Hi, i have SQL Server 2005 and a database set that is called, myCompany the problem is that i cant connect from my page to it, here is from the web.config: ( i have got this connectionstring from...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
5
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs...
8
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.