Click here to Skip to main content
13,004,094 members (113,381 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 3: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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2017
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