Jump to content

erikos

Members
  • Posts

    3
  • Joined

  • Last visited

erikos's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. erikos

    search engine

    Hello againtoday i try to use the sqlclient in my vb code Dim sqlmsg As String sqlmsg = "SELECT * FROM Item Where eFile Like '%" & text & "%'" '''text is given by user Dim connectionstring As String = cisproject.My.Settings.cisdatabaseConnectionString Dim i As Integer Using connection As New SqlClient.SqlConnection(connectionstring) connection.Open() Dim command As New SqlClient.SqlCommand(sqlmsg, connection) Dim reader As SqlClient.SqlDataReader = command.ExecuteReader() While reader.Read() For i = 0 To 7 ''''i have 8 columns in the table temptable.NewRow.Item(i) = reader(i) Next End While End Using when i run this it fills the temptable with the whole table in my databasecan you see the problem? Or can you suggest me a better solution to this?thank you in advanceerrikos
  2. erikos

    search engine

    Thank you very much....It helped me a lotSomething else now...I am creating a new temporary table like this : Public temptable As New cisDataSet.ItemDataTable i fill it with data and i want to use sql statements inside my codei do like this Dim sqlmsg As Stringsqlmsg = "SELECT SN, DateEntry, DateUpdate, GeneralDescription, Type, StoredSn, eFile, Status FROM item WHERE (GeneralDescription LIKE '%something%')"temptable.Select(sqlmsg) and when i run my application an error occurs For sure i am using in wrong way the sql statements in my codeCan anyone tell me the correct way...Thx in advanceerrikos
  3. erikos

    search engine

    Hi everyone...First of all I am using visual Basic 2005.I have created an sql database which contains 2 tables and some queries.What i want to do is to search the first table with multiple fields in every search.My table consist of :-SN (serial number)-GeneralDescription-Type-StoredSn (stored in serial number)-efile (electronic file)-StatusI have created a form which contains these fields and i want to search for a serial number dependig the fields i have written something on. Maybe i should use the AND, OR statements but how i will avoid the NULL fieldsI really need your help...thxerrikos
×
×
  • Create New...