Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET SQL Select paramaters

Status
Not open for further replies.

etjohnson81

Programmer
Jul 17, 2006
72
US
Hello all,

I am new to ASP.NET and I am finding out that the .execute isn't the same as asp.

How do I go about setting up a select query to run here?

Code:
        'Setup query
        Dim searchData As New SqlDataSource
        searchData.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString()

        searchData.SelectCommandType = SqlDataSourceCommandType.Text
        'searchData.SelectCommand = "SELECT tblSystems.txtSerial, tblCustomers.txtUsername, tblCustomers.txtFirstName, tblCustomers.txtLastName FROM tblCustomers INNER JOIN tblSystems ON tblCustomers.CustomerID = tblSystems.numCustomerID WHERE (tblSystems.txtSerial LIKE '%test%') OR (tblCustomers.txtFirstName LIKE '%test%') OR (tblCustomers.txtLastName LIKE '%test%') OR (tblCustomers.txtUsername LIKE '%test%')"
        Dim sqlStr As String
        sqlStr = searchData.SelectCommand = "SELECT tblSystems.txtSerial, tblCustomers.txtUsername, tblCustomers.txtFirstName, tblCustomers.txtLastName FROM tblCustomers INNER JOIN tblSystems ON tblCustomers.CustomerID = tblSystems.numCustomerID "

        'Check for unique row.
        Dim rowsAffected As Integer

        searchData.Select()

and i get that i am missing arguments in the select statement.

Any help is appreciated, or a good place for this.

My inserts are working fine, so I guess thats a step in the right direction, i can put it in, just cant get it out.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top