You haven't told the DataAdpater what you want it to retrieve.
sqlString needs to be either a SQL Statement such as
SELECT * FROM Flights
or the name of a stored procedure.
On 11/22/05, Real_Guy <[EMAIL PROTECTED]> wrote:
> Hi All,
> Im a beginner in ASP.Net.
> I tried to display data in drop down list from data base.
> The code is like this :
>
> Dim sqlString As String
> Dim DS As New DataSet()
> Dim myConn As SqlConnection
> Dim myDataAdapter As SqlDataAdapter
> Dim myDataView As New DataView()
>
> 'opening connection
> myConn = New
> sqlConnection("server=192.168.100.101;database=autoqplex;uid=sa;pwd=sa")
> myDataAdapter = New SqlDataAdapter(sqlString, myConn)
>
> 'myConn.Open()
> myDataAdapter.Fill(DS) 'here is the error
> 'myConn.Close()
>
> ddlFlightNo.DataSource = DS.Tables("mflightno").DefaultView
> ddlFlightNo.DataValueField = "flightno"
> ddlFlightNo.DataTextField = "flightno"
> ddlFlightNo.DataBind()
>
> but when i try to run it, an error occured (ExecuteReader: CommandText
> property has not been initialized)
>
> Can you tell me how to fix this problem
>
>
> many thanks in advance
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/