Click here to Skip to main content
11,920,211 members (45,611 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB .NET
i have a dataset [MUST] from my pc, i have 2 tables here and already contains lots of queries, so my problem now, our instructor wants a centralize database, it means we will use the database from other pc, though ill still use the same database and the same tables, also named [MUST], through LAN, i can connect to that server and use the same database via sql, my problem now is that how will i still be able to maintain my dataset and its queries, because removing my existing dataset and connecting the same dataset to new server will also remove all the queries i made, please help, what is the right thing to do, thanks
Posted 19-Feb-13 4:21am
Richard MacCutchan 19-Feb-13 9:23am
Nothing should change. Your dataset is instantiated when you start your program, and it gets filled from the database. Whether that database is on your PC or a server makes no difference.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use dataset to grab column and code behind to hold your query. For example:

Dim myReport As New rpt01 'my report design
Dim strSQL As String
Dim dtTemp As New ds.dtrptDataTable 'datatable for your dataset
Dim OleDbConn As New OracleConnection(ConnString)
Dim OleDbCmd As New OracleCommand
Dim OleDbAdapter As New OracleDataAdapter
    If OleDbConn.State = ConnectionState.Closed Then OleDbConn.Open()
    strSQL = "select * from yourtable"
    OleDbCmd.CommandText = strSQL
    OleDbCmd.Connection = OleDbConn
    OleDbAdapter.SelectCommand = OleDbCmd
    'then bind to your datasource(report,column or anything). in my case, I bind with my report
myReport.DataSource = dtTemp
myReport.DataMember = dtTemp.TableName
    If OleDbConn.State = ConnectionState.Open Then OleDbConn.Close()
End Try

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 455
1 phil.o 170
2 CPallini 150
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,495
2 Sergey Alexandrovich Kryukov 3,153
3 George Jonsson 2,810
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web01 | 2.8.151120.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100