So I added a datasource as a dataset to my project called ORAP_DS. It contains all the tables I need.
On a side not, I am trying to convert a vb6 program to vb.net. I have gotten the login to work and if I drag a table from the data source on the form, the data shows up. So I know the connections are working.
In vb6, there was some code:
I know there are no equivalents to record sets in .net, so how would I go about converting this. I was thinking LINQ or something, but not sure how to do it uses the dataset that is in my project. Do I need to create code to connect to the server? I am just not sure how to query ORAP_DS. I want to do it the right way. Any pointers? I have read about LINQ to Dataset, but everything i see are examples where they create a new dataset in code before doing anything. Since my dataset already exists, what do I need to do?
On a side not, I am trying to convert a vb6 program to vb.net. I have gotten the login to work and if I drag a table from the data source on the form, the data shows up. So I know the connections are working.
In vb6, there was some code:
VB.NET:
oracle_rs = New ADODB.Recordset
sqlstr = "select distinct w.wsum_payyr from fset.tfsetwsum w order by 1 desc"
oracle_rs.Open(sqlstr, oracle_conn)
oracle_rs.MoveFirst()
If oracle_rs.RecordCount <> 0 Then
lngreccnt = oracle_rs.RecordCount
mintmnuyrs = lngreccnt
intcol = 0
ReDim Preserve BaseYr(intcol)
BaseYr(intcol) = CInt(Year(Date.Now))
BaseYTD = BaseYr(intcol)
frm_mainmenu.Year1ToolStripMenuItem.Text = BaseYTD
Do Until oracle_rs.EOF
If CInt(oracle_rs(0).Value) <> Year(Date.Now) Then
intcol = intcol + 1
ReDim Preserve BaseYr(intcol)
frm_mainmenu.Year1ToolStripMenuItem.DropDownItems.Add(oracle_rs(0).Value.ToString)
BaseYr(intcol) = CInt(oracle_rs(0).Value)
End If
oracle_rs.MoveNext()
Loop
Else
ReDim Preserve BaseYr(0)
BaseYr(0) = CInt(Year(Date.Now))
End If
oracle_rs.Close()
I know there are no equivalents to record sets in .net, so how would I go about converting this. I was thinking LINQ or something, but not sure how to do it uses the dataset that is in my project. Do I need to create code to connect to the server? I am just not sure how to query ORAP_DS. I want to do it the right way. Any pointers? I have read about LINQ to Dataset, but everything i see are examples where they create a new dataset in code before doing anything. Since my dataset already exists, what do I need to do?