Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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
    2. help about dataset
      Hi, do you know why i got error on this: da = new SqlDataAdapter(); ds = new DataSet();
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default SQL and Dataset

    got it,
    Just needed to change "*" with "%"
    thanks,
    jayuya
    >-----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
    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
    >.
    >
    jayuya Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139