Solved

Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.SqlDataSource'

Posted on 2008-10-20
5
951 Views
Last Modified: 2012-05-05
I am trying to create a lookup with a drop down list box and I keep getting this error.  When I build the app it builds with no errors.  When I run the app I get this error message.  Can someone clue me in?


Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0029: Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.SqlDataSource'

Source Error:

 

Line 1:  <%@ Page Language="C#" MasterPageFile="~/TableMaintenance.Master" AutoEventWireup="true" CodeBehind="AddFedReg.aspx.cs" Inherits="HIPAAv2a.WebForm15" Title="Untitled Page" %>
Line 2:  
Line 3:  <%@ Register Assembly="Infragistics35.WebUI.Misc.v8.1, Version=8.1.20081.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
 

Source File: c:\Documents and Settings\hughesk.HDS\My Documents\Visual Studio 2005\Projects\HIPAAv2a\HIPAAv2a\AddFedReg.aspx    Line: 1
0
Comment
Question by:kwh3856
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22764676
find line in code where SqlDataSource is using or you are getting value from it ... see this error explain that you are trying to convert that datasource in string ... which is not possible that is why you are getting error ..

else please paste your code here.
0
 

Author Comment

by:kwh3856
ID: 22766648
I think that is exactly my problem.  I did not use any code to do this.  I just dragged the drop down list control to the desktop and told it to use a data source.  I pointed the datasource at the table in the database.  Could I just point the data source to a stored procedure and then have the stored procedure do a select fieldname from xyztable?

Thanks
Kenny
0
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 500 total points
ID: 22768133
hmm datasource should be object .. so it should be dataset or datatable ... .. i guess your binding giving the name of datatable ...

can you please paste that code
0
 

Author Closing Comment

by:kwh3856
ID: 31508155
Thanks BondinASP.  I appreciate your help.
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22869897
your welcome
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question