none
Problem Designing DataSets and DataTables RRS feed

  • Question

  • I can access the Pervasive SQL server on my machine that I have loaded for testing, but when I try to access the server with the real data that everyone else is using, the server explorer will not allow me to open up tables in databases on the remote server. I get an error message from VS2005 saying, "Unable to build the 'VS.Triggers' collection because execution of the SQL query failed. See the inner exception for details."

    Most of the time that is all I can find out, but once I got an error message saying that the inner exception was a failure on a stored procedure.

    Alternately, if I add a DataGridView too my form and try to specify a datasource that way, trying to specify a connection string that connects to the remote SQL server gives the same error as above, except that it says, "'VS.Procedures' collection" was the problem. That is VS.Procedures rather than VS.Triggers as in the previous example. When I hit the Test Connection button it passes the test.

    How can I fix this stored procedure problem, VS2005 is useless too me now without being able to access the database.

    Alternately, how can I programmattically connect a DataGridView too a DataSource?


    Wednesday, December 5, 2007 11:29 PM

Answers

  • You need to download and install the Pervasive .NET provider and add references to the provider in VS to use it.  Hope this helps.

     

    http://www.pervasive.com/developerzone/platforms/net.asp

    Wednesday, December 26, 2007 9:51 PM
  • I've done some research on this and think that the problem is more related to the DDFs (Data Dictionary Files).  I'm working with some DDFs that cause these errors and will post once I have more information.These errors do not occur with the Pervasive sample data (DEMODATA). 
    To answer the other question, here's some C# code that I threw together to use a DataGridView with PSQL

     //connect to PSQL
                string connStr = "ServerDSN=DEMODATA";
                PsqlConnection pConnection = new PsqlConnection(connStr);
                pConnection.Open();

                //create DataSet
                DataSet dataSet = new DataSet("pDataSet");

                //set the dataAdapter for "class" table
                PsqlDataAdapter da = new PsqlDataAdapter("select * from class",pConnection);


                //fill the dataTable country (which is located in the dataset) with the content of the database
                da.FillSchema(dataSet, SchemaType.Source,"class");
                da.Fill(dataSet, "class");


                //bind the dataTable to the DataGridView
                dataGridView1.AutoGenerateColumns = true;  
                dataGridView1.DataSource = dataSet.Tables["class"];
    Thursday, December 27, 2007 12:30 AM

All replies

  • I have the exact same issue and have not found any solution or documentation on the problem

     

     

    Robert A.

    Wednesday, December 26, 2007 8:45 PM
  • You need to download and install the Pervasive .NET provider and add references to the provider in VS to use it.  Hope this helps.

     

    http://www.pervasive.com/developerzone/platforms/net.asp

    Wednesday, December 26, 2007 9:51 PM
  • I've done some research on this and think that the problem is more related to the DDFs (Data Dictionary Files).  I'm working with some DDFs that cause these errors and will post once I have more information.These errors do not occur with the Pervasive sample data (DEMODATA). 
    To answer the other question, here's some C# code that I threw together to use a DataGridView with PSQL

     //connect to PSQL
                string connStr = "ServerDSN=DEMODATA";
                PsqlConnection pConnection = new PsqlConnection(connStr);
                pConnection.Open();

                //create DataSet
                DataSet dataSet = new DataSet("pDataSet");

                //set the dataAdapter for "class" table
                PsqlDataAdapter da = new PsqlDataAdapter("select * from class",pConnection);


                //fill the dataTable country (which is located in the dataset) with the content of the database
                da.FillSchema(dataSet, SchemaType.Source,"class");
                da.Fill(dataSet, "class");


                //bind the dataTable to the DataGridView
                dataGridView1.AutoGenerateColumns = true;  
                dataGridView1.DataSource = dataSet.Tables["class"];
    Thursday, December 27, 2007 12:30 AM