Solved

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

Posted on 2008-10-20
5
942 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now