Home All Groups Group Topic Archive Search About

Check database table for pre-existing record

Author
23 Jun 2009 11:07 PM
Islay Rodriguez Jr.
I'm trying to check if a "CompanyProductNumber" already exists in a database
table
from within the "CompanyPruductNumber_TextChanged" event handler.

I have configured an SQLDataSource from the tool box called
"CheckRawMaterial"
with an sql select statement:

SELECT RawMaterialName FROM RawMaterial WHERE (CompanyProductNumber =
@CompanyProdNum) AND (CompanyID = @CompID)

with parameters @CompanyProdNum and @CompID which are bound to a
textbox.text control and a session field value. I have tested the SQL
statement in the configuration wizard and it works.

My problem is that I can't figure out how to execute the Select staement
from within the "CompanyPruductNumber_TextChanged" event handler. The
"CheckRawMaterial" object has no execute method.

I would appreciate any help.

Thanks,

--
Islay

Author
24 Jun 2009 9:37 AM
Patrice
A SqlDataSource is intended to be used as a source of data for controls
(such as the GridView or FormView). If you want to just execute a query, a
SqlCommand object seems more appropriate...

--
Patrice

"Islay Rodriguez Jr." <islay@newsgroups.nospam> a écrit dans le message de
groupe de discussion : 986CB47D-9C1C-4D6E-88ED-F67F8E860***@microsoft.com...
Show quoteHide quote
> I'm trying to check if a "CompanyProductNumber" already exists in a
> database
> table
> from within the "CompanyPruductNumber_TextChanged" event handler.
>
> I have configured an SQLDataSource from the tool box called
> "CheckRawMaterial"
> with an sql select statement:
>
> SELECT RawMaterialName FROM RawMaterial WHERE (CompanyProductNumber =
> @CompanyProdNum) AND (CompanyID = @CompID)
>
> with parameters @CompanyProdNum and @CompID which are bound to a
> textbox.text control and a session field value. I have tested the SQL
> statement in the configuration wizard and it works.
>
> My problem is that I can't figure out how to execute the Select staement
> from within the "CompanyPruductNumber_TextChanged" event handler. The
> "CheckRawMaterial" object has no execute method.
>
> I would appreciate any help.
>
> Thanks,
>
> --
> Islay
Are all your drivers up to date? click for free checkup

Author
24 Jun 2009 10:39 AM
Islay Rodriguez Jr.
Thanks for your quick response, Can you direct me to some good examples?

Islay
--
Islay


Show quoteHide quote
"Islay Rodriguez Jr." wrote:

> I'm trying to check if a "CompanyProductNumber" already exists in a database
> table
> from within the "CompanyPruductNumber_TextChanged" event handler.
>
> I have configured an SQLDataSource from the tool box called
> "CheckRawMaterial"
> with an sql select statement:
>
> SELECT RawMaterialName FROM RawMaterial WHERE (CompanyProductNumber =
> @CompanyProdNum) AND (CompanyID = @CompID)
>
> with parameters @CompanyProdNum and @CompID which are bound to a
> textbox.text control and a session field value. I have tested the SQL
> statement in the configuration wizard and it works.
>
> My problem is that I can't figure out how to execute the Select staement
> from within the "CompanyPruductNumber_TextChanged" event handler. The
> "CheckRawMaterial" object has no execute method.
>
> I would appreciate any help.
>
> Thanks,
>
> --
> Islay
Author
24 Jun 2009 11:02 AM
Patrice
You'll find the documentation at
http://msdn.microsoft.com/en-us/library/tyy0sz6b(VS.80).aspx and around...

--
Patrice

"Islay Rodriguez Jr." <islay@newsgroups.nospam> a écrit dans le message de
groupe de discussion : 20485F07-377B-460A-A1D9-3676FF6D4***@microsoft.com...
Show quoteHide quote
> Thanks for your quick response, Can you direct me to some good examples?
>
> Islay
> --
> Islay
>
>
> "Islay Rodriguez Jr." wrote:
>
>> I'm trying to check if a "CompanyProductNumber" already exists in a
>> database
>> table
>> from within the "CompanyPruductNumber_TextChanged" event handler.
>>
>> I have configured an SQLDataSource from the tool box called
>> "CheckRawMaterial"
>> with an sql select statement:
>>
>> SELECT RawMaterialName FROM RawMaterial WHERE (CompanyProductNumber =
>> @CompanyProdNum) AND (CompanyID = @CompID)
>>
>> with parameters @CompanyProdNum and @CompID which are bound to a
>> textbox.text control and a session field value. I have tested the SQL
>> statement in the configuration wizard and it works.
>>
>> My problem is that I can't figure out how to execute the Select staement
>> from within the "CompanyPruductNumber_TextChanged" event handler. The
>> "CheckRawMaterial" object has no execute method.
>>
>> I would appreciate any help.
>>
>> Thanks,
>>
>> --
>> Islay
Author
24 Jun 2009 11:19 AM
Islay Rodriguez Jr.
Thanks again
--
Islay


Show quoteHide quote
"Patrice" wrote:

> You'll find the documentation at
> http://msdn.microsoft.com/en-us/library/tyy0sz6b(VS.80).aspx and around...
>
> --
> Patrice
>
> "Islay Rodriguez Jr." <islay@newsgroups.nospam> a crit dans le message de
> groupe de discussion : 20485F07-377B-460A-A1D9-3676FF6D4***@microsoft.com...
> > Thanks for your quick response, Can you direct me to some good examples?
> >
> > Islay
> > --
> > Islay
> >
> >
> > "Islay Rodriguez Jr." wrote:
> >
> >> I'm trying to check if a "CompanyProductNumber" already exists in a
> >> database
> >> table
> >> from within the "CompanyPruductNumber_TextChanged" event handler.
> >>
> >> I have configured an SQLDataSource from the tool box called
> >> "CheckRawMaterial"
> >> with an sql select statement:
> >>
> >> SELECT RawMaterialName FROM RawMaterial WHERE (CompanyProductNumber =
> >> @CompanyProdNum) AND (CompanyID = @CompID)
> >>
> >> with parameters @CompanyProdNum and @CompID which are bound to a
> >> textbox.text control and a session field value. I have tested the SQL
> >> statement in the configuration wizard and it works.
> >>
> >> My problem is that I can't figure out how to execute the Select staement
> >> from within the "CompanyPruductNumber_TextChanged" event handler. The
> >> "CheckRawMaterial" object has no execute method.
> >>
> >> I would appreciate any help.
> >>
> >> Thanks,
> >>
> >> --
> >> Islay
>
>

Bookmark and Share

Post Thread options