views and dataset

views and dataset

Postby guest » Wed 15 Dec 2004 14:57

hi,

i have a problem with views and datasets. if a take a view in the data adapter i get no data in the dataset.

what' wrong ?

thanks!
guest
 

views and dataset

Postby Yuri » Thu 16 Dec 2004 15:33

Please send us a code sample and sql script to reproduce the problem.

See example of working with dataadapter (PostgreSQLDirect.NET 1.85.3, PostgreSQL 7.4.2):
Code: Select all
C#:
      PgSqlConnection connection = new PgSqlConnection("host=server;user id=postgres;database=test;");
      connection.Open();
      PgSqlDataAdapter da = new PgSqlDataAdapter("SELECT * from \"testView\"",  connection);
      System.Data.DataTable data = new System.Data.DataTable();
      da.Fill(data);

SQL:
      CREATE OR REPLACE VIEW "testView" AS
      SELECT emp.ename, dept.dname, emp.job FROM emp, dept  WHERE dept.deptno = emp.deptno;
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07

dataset and views

Postby guest » Tue 28 Dec 2004 13:00

it works, but is their a way to do the same in a graphical way.

perhaps we can use the PgSqlDataAdapter with Text and Parameters ??

thanks
guest
 

dataset and views

Postby Yuri » Wed 29 Dec 2004 15:43

If you would like to reflect data at the form please see our demo project DataSet and read MSDN about data binding.
If you need the same at design-time you can use verbs "Configure DataAdapter", "Fill Dataset...".
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07


Return to dotConnect for PostgreSQL