Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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