Ask a Question related to ASP.NET General, Design and Development.
-
Alvin Bruney #1
Re: SQL and Dataset
try MATCHES instead of LIKE
"jayuya" <jayuya@cox.net> wrote in message
news:017e01c35497$ad3d3390$a601280a@phx.gbl...> What is wrong with this SQL statement below. I am trying
> to fill the data grid and apparently there is something
> wrong with my statament "Like"
>
> If I change the SQL to be Where FirstName =??? it works
>
> thanks in advance
> jayuya
>
> sql = "SELECT Id,FirstName,MiddleName,LastName FROM
> Defendant WHERE FirstName Like '*" &
> SearchCriteria.ToString & "*';"
>
> db.OpenConn() 'open db connection
> db.SetDataAdapter(sql, "Defendant") 'sets the data adapter
> With Me.DG_Defendant
> .DataSource = db.DtSet.Tables("Defendant").DefaultView
> Try 'binddata
> .DataBind() 'binds the data to data grid
> Catch
> .CurrentPageIndex = 0
> .DataBind()
> End Try
> End With
> db.DataAdapter.Dispose() 'close the data adapter
> db.CloseConn() 'closes db connection
Alvin Bruney Guest
-
Dataset.length(), dataset.hasnext() not working.. Why?
I have a dataset that has 3 items, yet when I test for it, it is "undefined". Any ideas why this property would not be available? Thanks Geoff -
help about dataset
Hi, do you know why i got error on this: da = new SqlDataAdapter(); ds = new DataSet(); -
dataset.Databind error when dataset XML contains attributes...
I've come accross an interesting problem populating an asp.net datagrid. I am trying to bind XML data to a datagrid as I've done in countless other... -
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset
Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data... -
DataSet to DataSet
Hello, I'm trying to copy data from one DataSet to another DataSet. My question is, how do you access a column in a specific row. Similar to an... -
jayuya #2
SQL and Dataset
got it,
Just needed to change "*" with "%"
thanks,
jayuya
adapter>-----Original Message-----
>What is wrong with this SQL statement below. I am trying
>to fill the data grid and apparently there is something
>wrong with my statament "Like"
>
>If I change the SQL to be Where FirstName =??? it works
>
>thanks in advance
>jayuya
>
>sql = "SELECT Id,FirstName,MiddleName,LastName FROM
>Defendant WHERE FirstName Like '*" &
>SearchCriteria.ToString & "*';"
>
>db.OpenConn() 'open db connection
>db.SetDataAdapter(sql, "Defendant") 'sets the data>With Me.DG_Defendant
> .DataSource = db.DtSet.Tables("Defendant").DefaultView
> Try 'binddata
> .DataBind() 'binds the data to data grid
> Catch
> .CurrentPageIndex = 0
> .DataBind()
>End Try
>End With
>db.DataAdapter.Dispose() 'close the data adapter
>db.CloseConn() 'closes db connection
>.
>jayuya Guest



Reply With Quote

