Hello Pinturiccio
Thanks for the solution , now everything works fine
Search found 14 matches
- Tue 17 Jan 2012 11:51
- Forum: dotConnect for PostgreSQL
- Topic: error select statement with multiple table in pgsqldatatable
- Replies: 9
- Views: 1712
- Thu 12 Jan 2012 06:22
- Forum: dotConnect for PostgreSQL
- Topic: error select statement with multiple table in pgsqldatatable
- Replies: 9
- Views: 1712
Saying that the TextBox value is not saved, did not mean that TextBox is empty after the update
with this i mean that textbox(i.e txtcostcode) value which i entered, is not get saved in database
only autoincremented field get saved and all the fields which i entered through binding context remain blank in database
i use the below code
Me.BindingContext(myDataTable).CancelCurrentEdit()
Me.BindingContext(myDataTable).AddNew()
because when my form load with this code one new row get created in datatable, as you say with values
(0, Null) but when i click on save button
with the below code
Me.BindingContext(myDataTable).EndCurrentEdit()
all the value which i enter in form get inserted in datatable
and with mydatatable.update() method all that values which are in datatable get inserted in database
i think you didnt get my question,
see i want to fetch the record from two tables (table1 and departments) ,but insert record in only one table i.e table1
two tables field are like this
table1(costcodeid,costcode,departmentid)
departments(departmentid,departmentname)
from my form i m inserting costcode and departmentid in table1, in the same form i have one grid which shows costcode and departmentname,
just to show the departmentname in grid, thats y i want to fetch record from two table departments and table1
but when i write this query
myDataTable = New PgSqlDataTable(New PgSqlCommand("select table1.*,departments.departmentname from table1,departments where
table1.departmentid=departments.departmentid", Database.Connection))
no values from textbox get saved in database
with this i mean that textbox(i.e txtcostcode) value which i entered, is not get saved in database
only autoincremented field get saved and all the fields which i entered through binding context remain blank in database
i use the below code
Me.BindingContext(myDataTable).CancelCurrentEdit()
Me.BindingContext(myDataTable).AddNew()
because when my form load with this code one new row get created in datatable, as you say with values
(0, Null) but when i click on save button
with the below code
Me.BindingContext(myDataTable).EndCurrentEdit()
all the value which i enter in form get inserted in datatable
and with mydatatable.update() method all that values which are in datatable get inserted in database
i think you didnt get my question,
see i want to fetch the record from two tables (table1 and departments) ,but insert record in only one table i.e table1
two tables field are like this
table1(costcodeid,costcode,departmentid)
departments(departmentid,departmentname)
from my form i m inserting costcode and departmentid in table1, in the same form i have one grid which shows costcode and departmentname,
just to show the departmentname in grid, thats y i want to fetch record from two table departments and table1
but when i write this query
myDataTable = New PgSqlDataTable(New PgSqlCommand("select table1.*,departments.departmentname from table1,departments where
table1.departmentid=departments.departmentid", Database.Connection))
no values from textbox get saved in database
- Thu 29 Dec 2011 11:25
- Forum: dotConnect for PostgreSQL
- Topic: error select statement with multiple table in pgsqldatatable
- Replies: 9
- Views: 1712
thanx Pinturiccio for your reply ,
but i dont want to insert record into two table ,i want to fetch record from two tables but insert record in only one table
i have made some modification in my code now record get inserted but binding context is not working
here is my code
myDataTable = New PgSqlDataTable(New PgSqlCommand("select * from table1,departments where table1.departmentid=departments.departmentid", Database.Connection))
With myDataTable
.Fill()
.InsertCommand = New PgSqlCommand("insert into table1(costcodeid,costcode) Values(DEFAULT,:costcode) returning costcodeid", Database.Connection)
.InsertCommand.Parameters.Add(":costcode", PgSqlType.Int, 0, "costcode")
End With
myDataTable.Columns("costcodeid").DefaultValue = 0
Call txtCostcode.DataBindings.Add("Text", myDataTable, "costcode")
Me.BindingContext(myDataTable).CancelCurrentEdit()
Me.BindingContext(myDataTable).AddNew()
and on save button
Me.BindingContext(myDataTable).EndCurrentEdit()
myDataTable.Update()
myDataTable.AcceptChanges()
with this code record get inserted but textbox value not get save
if i write simple single table query in select statement then everything works fine but i want to fetch record from multiple table is that some thing i m missing in above code
but i dont want to insert record into two table ,i want to fetch record from two tables but insert record in only one table
i have made some modification in my code now record get inserted but binding context is not working
here is my code
myDataTable = New PgSqlDataTable(New PgSqlCommand("select * from table1,departments where table1.departmentid=departments.departmentid", Database.Connection))
With myDataTable
.Fill()
.InsertCommand = New PgSqlCommand("insert into table1(costcodeid,costcode) Values(DEFAULT,:costcode) returning costcodeid", Database.Connection)
.InsertCommand.Parameters.Add(":costcode", PgSqlType.Int, 0, "costcode")
End With
myDataTable.Columns("costcodeid").DefaultValue = 0
Call txtCostcode.DataBindings.Add("Text", myDataTable, "costcode")
Me.BindingContext(myDataTable).CancelCurrentEdit()
Me.BindingContext(myDataTable).AddNew()
and on save button
Me.BindingContext(myDataTable).EndCurrentEdit()
myDataTable.Update()
myDataTable.AcceptChanges()
with this code record get inserted but textbox value not get save
if i write simple single table query in select statement then everything works fine but i want to fetch record from multiple table is that some thing i m missing in above code
- Thu 29 Dec 2011 05:21
- Forum: dotConnect for PostgreSQL
- Topic: error select statement with multiple table in pgsqldatatable
- Replies: 9
- Views: 1712
- Wed 28 Dec 2011 07:14
- Forum: dotConnect for PostgreSQL
- Topic: error select statement with multiple table in pgsqldatatable
- Replies: 9
- Views: 1712
error select statement with multiple table in pgsqldatatable
hi,
i am using pgsqldatatable class to insert record
but i m facing a wired problem if i use following simple query
dim myDataTable as PgSqlDataTable= New PgSqlDataTable(New PgSqlCommand("select * from table1", Database.Connection))
everything works fine my record get inserted
but if i use query to fetch record from multiple table like this
dim myDataTable as PgSqlDataTable= New PgSqlDataTable(New PgSqlCommand("select * from table1,table2 where table1.field1=table2.field1", Database.Connection))
then records not insert no error appears
but no record inserted in database
i m using devart version 5.50.214.0
please help its very urgent
i am using pgsqldatatable class to insert record
but i m facing a wired problem if i use following simple query
dim myDataTable as PgSqlDataTable= New PgSqlDataTable(New PgSqlCommand("select * from table1", Database.Connection))
everything works fine my record get inserted
but if i use query to fetch record from multiple table like this
dim myDataTable as PgSqlDataTable= New PgSqlDataTable(New PgSqlCommand("select * from table1,table2 where table1.field1=table2.field1", Database.Connection))
then records not insert no error appears
but no record inserted in database
i m using devart version 5.50.214.0
please help its very urgent
- Sat 24 Sep 2011 04:54
- Forum: dotConnect for PostgreSQL
- Topic: PgSqlException "Server did not respond within the specified
- Replies: 2
- Views: 2796
- Fri 23 Sep 2011 10:17
- Forum: dotConnect for PostgreSQL
- Topic: PgSqlException "Server did not respond within the specified
- Replies: 2
- Views: 2796
PgSqlException "Server did not respond within the specified
hi,
i had stored a large file upto 300 mb in pg_largeobject table
but when i m going to remove this large object data,
exception occur "server did not respond within the specified timeout interval"
following query are used to remove the large object
Call Database.ExecuteSQL("select lo_unlink(" & oid.ToString & ")")
where oid is the loid field of pg_largeobject table
i had stored a large file upto 300 mb in pg_largeobject table
but when i m going to remove this large object data,
exception occur "server did not respond within the specified timeout interval"
following query are used to remove the large object
Call Database.ExecuteSQL("select lo_unlink(" & oid.ToString & ")")
where oid is the loid field of pg_largeobject table
- Thu 15 Sep 2011 11:27
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
- Fri 29 Jul 2011 05:14
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
- Wed 27 Jul 2011 10:32
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
- Wed 29 Jun 2011 07:51
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
- Sat 11 Jun 2011 06:03
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
hello shalex,
i had check this backup and restore method on two different pc (with file of size 300 mb in my database ) of same configuration (2 GB RAM,250 GB Hard Drive,os windows 7 ) ,
error remains same (out of memory) but two different size backup file created ,
on one pc error appears after 460mb backup file created and in another it appear after 14 mb backup file created , and this time error appears on backup method of pgsqldump class.
Any update from ur side on this issue
i had check this backup and restore method on two different pc (with file of size 300 mb in my database ) of same configuration (2 GB RAM,250 GB Hard Drive,os windows 7 ) ,
error remains same (out of memory) but two different size backup file created ,
on one pc error appears after 460mb backup file created and in another it appear after 14 mb backup file created , and this time error appears on backup method of pgsqldump class.
Any update from ur side on this issue
- Thu 09 Jun 2011 04:36
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
- Mon 06 Jun 2011 11:17
- Forum: dotConnect for PostgreSQL
- Topic: error in pgsqldumb class to restore large object
- Replies: 12
- Views: 1682
error in pgsqldumb class to restore large object
hi,
i am using pgsqldump class to backup and restore my postgre database
using method backup and restore but when i restore large object (some what 46MB in size) i got the exception
"Exception of type 'System.OutOfMemoryException' was thrown."
while creting backup file i had made IncludeBlob = true
for backup i had write this code
Dim pgdumb As New PgSqlDump
pgdumb.Connection = Connection
pgdumb.Mode = Devart.Data.PostgreSql.DumpMode.Data
pgdumb.IncludeBlob = True
pgdumb.Backup("D:\testbackup.backup")
Connection.Close()
for restore
Dim pgDump As PgSqlDump = New PgSqlDump
pgDump.Connection = conn
pgDump.Restore("D:\testbackup.backup")
conn.close
ANY SuGESSTION PLZ HELP [/code]
i am using pgsqldump class to backup and restore my postgre database
using method backup and restore but when i restore large object (some what 46MB in size) i got the exception
"Exception of type 'System.OutOfMemoryException' was thrown."
while creting backup file i had made IncludeBlob = true
for backup i had write this code
Dim pgdumb As New PgSqlDump
pgdumb.Connection = Connection
pgdumb.Mode = Devart.Data.PostgreSql.DumpMode.Data
pgdumb.IncludeBlob = True
pgdumb.Backup("D:\testbackup.backup")
Connection.Close()
for restore
Dim pgDump As PgSqlDump = New PgSqlDump
pgDump.Connection = conn
pgDump.Restore("D:\testbackup.backup")
conn.close
ANY SuGESSTION PLZ HELP [/code]