Check database table for pre-existing record

Discussion in 'ASP .Net Web Controls' started by Islay Rodriguez Jr., Jun 24, 2009.

  1. 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
    Islay Rodriguez Jr., Jun 24, 2009
    #1
    1. Advertising

  2. 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
    Islay Rodriguez Jr., Jun 24, 2009
    #2
    1. Advertising

  3. Thanks again
    --
    Islay


    "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." <> a crit dans le message de
    > groupe de discussion : ...
    > > 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

    >
    >
    Islay Rodriguez Jr., Jun 24, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rocky Moore
    Replies:
    7
    Views:
    1,721
    mikeb
    Jan 14, 2004
  2. Andy
    Replies:
    7
    Views:
    5,631
    steve
    Apr 5, 2006
  3. André
    Replies:
    0
    Views:
    3,730
    André
    Jun 25, 2006
  4. André
    Replies:
    0
    Views:
    434
    André
    Jun 25, 2006
  5. Replies:
    6
    Views:
    509
Loading...

Share This Page