asp.net 2.0 vb.net Index Server
-
I am working on a job posting web site and I am using the index server to be able to search thru individual jobs that get ftp up. The problem is how do I truncate the data or extract the data out of the characterization. Here is an example of the contents of my characterization. 15010, CEV Demo Chief Engineer - Space . Category: Engineering. Region: CA-Los Angeles/Orange Counties. City: El Segundo. State: CA. Rate: $60.00 - $65.00. Duration: 6 - 12 Months. Description: Technical Integrity, CEV, Spacecraft Systems~. RESPONSIBILIITES:. Responsible to the CEV Demo IPT Leader and Program I need to bind to a gridview to the first line... that would only be the job number. Then I want the rest for the next column to have the job title. After that, the description is my keywords for my next column and then a combo of State and City in one column and the final column to have the Rate. I thought I could use substrings and pathindex to get the individual data out, but that didn't work. thanks mjc
-
I am working on a job posting web site and I am using the index server to be able to search thru individual jobs that get ftp up. The problem is how do I truncate the data or extract the data out of the characterization. Here is an example of the contents of my characterization. 15010, CEV Demo Chief Engineer - Space . Category: Engineering. Region: CA-Los Angeles/Orange Counties. City: El Segundo. State: CA. Rate: $60.00 - $65.00. Duration: 6 - 12 Months. Description: Technical Integrity, CEV, Spacecraft Systems~. RESPONSIBILIITES:. Responsible to the CEV Demo IPT Leader and Program I need to bind to a gridview to the first line... that would only be the job number. Then I want the rest for the next column to have the job title. After that, the description is my keywords for my next column and then a combo of State and City in one column and the final column to have the Rate. I thought I could use substrings and pathindex to get the individual data out, but that didn't work. thanks mjc
Ok, I got it to work. What I did was saved query result into a dataset and then using string functions to get my data out and then create a datatable and added each row with data from the dataset. Dim accessConnection As OleDbConnection = New OleDbConnection("Provider=MSIDXS") Dim accessCommand As New OleDbCommand(query, accessConnection) Dim newjobsDataAdapter As New OleDbDataAdapter(accessCommand) Dim myDataSet As New DataSet() Dim newjobsDataTable As New DataTable("newjobs") newjobsDataAdapter.Fill(myDataSet, "newjobs") Dim dataTableRowCount As Integer = newjobsDataTable.Rows.Count Dim myDataTable As DataTable = myDataSet.Tables(0) Dim tempdata As String Dim spc1 As Integer Dim spc2 As Integer Dim spc3 As Integer Dim spc4 As Integer myDataTable.Columns.Add(New DataColumn("ID", GetType(Integer))) myDataTable.Columns.Add(New DataColumn("JobID", GetType(Integer))) myDataTable.Columns.Add(New DataColumn("JobTitle", GetType(String))) myDataTable.Columns.Add(New DataColumn("Keywords", GetType(String))) myDataTable.Columns.Add(New DataColumn("Location", GetType(String))) myDataTable.Columns.Add(New DataColumn("Rate", GetType(String))) For i = 0 To myDataTable.Rows.Count - 1 myDataTable.Rows(i)("ID") = i + 1 tempdata = myDataTable.Rows(i)("characterization") spc1 = InStr(myDataTable.Rows(i)("characterization"), ",") spc2 = InStr(myDataTable.Rows(i)("characterization"), ". Category") myDataTable.Rows(i)("JobID") = Convert.ToInt32(Mid(tempdata, 1, spc1 - 1)) myDataTable.Rows(i)("JobTitle") = LTrim(Mid(tempdata, spc1 + 2, spc2 - 8)) spc1 = InStr(myDataTable.Rows(i)("characterization"), "Description") spc2 = InStr(spc1, myDataTable.Rows(i)("characterization"), "~.") myDataTable.Rows(i)("Keywords") = LTrim(Mid(tempdata, spc1 + 13, spc2 - spc1 - 12)) spc1 = InStr(myDataTable.Rows(i)("characterization"), "State") spc2 = InStr(spc1, myDataTable.Rows(i)("characterization"), ".") spc3 = InStr(myDataTable.Rows(i)("characterization"), "City") spc4 = InStr(spc3, myDataTable.Rows(i)("characterization"), ".") myDataTable.Rows(i)("Location")