Taishi-
You need to Open the connection before calling ExecuteReader.
You should also Close the connection when done...
Steve Stein
VB Team
This posting is provided "AS IS" with no warranties and confers no rights.
--------------------
[quoted text, click to view] >From: "Taishi" <taishi_bak@hotmail.com>
>Subject: Connection Property error
>Date: Wed, 11 Feb 2004 12:03:12 -0600
>Lines: 24
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Message-ID: <OgSyNlM8DHA.2316@TK2MSFTNGP09.phx.gbl>
>Newsgroups:
microsoft.public.certification.visualstudio,microsoft.public.dotnet.framewor
k,microsoft.public.dotnet.framework.aspnet,microsoft.public.dotnet.languages
.vb,microsoft.public.dotnet.languages.vb.controls,microsoft.public.vstudio.d
evelopment
[quoted text, click to view] >NNTP-Posting-Host: 192.131.85.169
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
[quoted text, click to view] >Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework:64881
microsoft.public.dotnet.framework.aspnet:209348
microsoft.public.dotnet.languages.vb:180549
microsoft.public.dotnet.languages.vb.controls:3984
microsoft.public.vstudio.development:4332
microsoft.public.certification.visualstudio:3769
[quoted text, click to view] >X-Tomcat-NG: microsoft.public.dotnet.languages.vb.controls
>
>ExecuteReader: Connection property has not been initialized.
>
>Description: An unhandled exception occurred during the execution of the
>current web request. Please review the stack trace for more information
>about the error and where it originated in the code.
>
>Exception Details: System.InvalidOperation Exception: ExecuteReader:
>Connection property has not been initialized.
>
>Source Error:
>
>Line 142:
>Line 143: drStores = cmdStores.ExecuteReader()
>Line 144: ddlStores.DataSource = drStores
>Line 145: ddlStores.DataTextField = "stor_name"
>
>
>Any suggestions on how to resolve this error?
>
>Thanks,
>T.
>
>
>
>
Hi Taishi-
The dataset on your form is the same dataset that is declared in code. The
form designer and controls are a visual representation of the code.
Steve Stein
VB Team
This posting is provided "AS IS" with no warranties and confers no rights.
-------------------
[quoted text, click to view] >From: "Taishi" <taishi_bak@hotmail.com>
>References: <OgSyNlM8DHA.2316@TK2MSFTNGP09.phx.gbl>
<4UR9ERM9DHA.1988@cpmsftngxa07.phx.gbl>
>Subject: Re: Connection Property error
>Date: Tue, 17 Feb 2004 10:16:57 -0600
>Lines: 85
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Message-ID: <eWyv8FX9DHA.972@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.languages.vb.controls
>NNTP-Posting-Host: 192.131.85.191
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
[quoted text, click to view] >Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.languages.vb.controls:4036
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb.controls
>
>Thanks Steven.
>
>I also found another problem. I had a DataSet defined in the Form and in
>the code.
>
>It's working!! Finally!!!
>
>Why can't you have it defined in both places?
>
>T.
>
>""Steven Stein [MSFT]"" <sstein@online.microsoft.com> wrote in message
>news:4UR9ERM9DHA.1988@cpmsftngxa07.phx.gbl...
>>
>>
>> You need to Open the connection before calling ExecuteReader.
>>
>> You should also Close the connection when done...
>>
>>
>> Steve Stein
>> VB Team
>>
>> This posting is provided "AS IS" with no warranties and confers no
rights.
>>
>>
>> --------------------
>> >From: "Taishi" <taishi_bak@hotmail.com>
>> >Subject: Connection Property error
>> >Date: Wed, 11 Feb 2004 12:03:12 -0600
>> >Lines: 24
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>> >Message-ID: <OgSyNlM8DHA.2316@TK2MSFTNGP09.phx.gbl>
>> >Newsgroups:
>>
>microsoft.public.certification.visualstudio,microsoft.public.dotnet.framewo
r
>>
>k,microsoft.public.dotnet.framework.aspnet,microsoft.public.dotnet.language
s
>>
>vb,microsoft.public.dotnet.languages.vb.controls,microsoft.public.vstudio.d
>> evelopment
>> >NNTP-Posting-Host: 192.131.85.169
>> >Path:
>>
>cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA
0
>> 5.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>> >Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework:64881
>> microsoft.public.dotnet.framework.aspnet:209348
>> microsoft.public.dotnet.languages.vb:180549
>> microsoft.public.dotnet.languages.vb.controls:3984
>> microsoft.public.vstudio.development:4332
>> microsoft.public.certification.visualstudio:3769
>> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb.controls
>> >
>> >ExecuteReader: Connection property has not been initialized.
>> >
>> >Description: An unhandled exception occurred during the execution of the
>> >current web request. Please review the stack trace for more information
>> >about the error and where it originated in the code.
>> >
>> >Exception Details: System.InvalidOperation Exception: ExecuteReader:
>> >Connection property has not been initialized.
>> >
>> >Source Error:
>> >
>> >Line 142:
>> >Line 143: drStores = cmdStores.ExecuteReader()
>> >Line 144: ddlStores.DataSource = drStores
>> >Line 145: ddlStores.DataTextField = "stor_name"
>> >
>> >
>> >Any suggestions on how to resolve this error?
>> >
>> >Thanks,
>> >T.
>> >
>> >
>> >
>> >
>>
>
>
>
Don't see what you're looking for? Try a search.