Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 982
  • Last Modified:

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

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
kwh3856
Asked:
kwh3856
  • 3
  • 2
1 Solution
 
Gyanendra SinghArchitectCommented:
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
 
kwh3856Author Commented:
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
 
Gyanendra SinghArchitectCommented:
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
 
kwh3856Author Commented:
Thanks BondinASP.  I appreciate your help.
0
 
Gyanendra SinghArchitectCommented:
your welcome
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now