Scheme problems in VS2005 data connection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 13 Jul 2007 15:50

any way to update this to look at the full prof version?
What do you mean? You need to correct the reference in your web.config file.
The corrected reference should read like

Code: Select all

'CoreLab.PostgreSql.Web, Version=3.00.10.0, Culture=neutral, PublicKeyToken=09af7300eec23701' 

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Fri 13 Jul 2007 16:49

thanks, that cleared up the web.config error, and then I got the next error on another page to update this value:


On my next debug I then got 17 errors which I have no idea how they are related to updating the corelab version.

These are the same errors I got when I removed the trial version of the corelab .net driver yesterday. When I re-installed the trial version, the errors went away.

So I'm confused how these relate to the new version.

Warning 1 Validation (XHTML 1.0 Transitional): Attribute 'border' is considered outdated. A newer construct is recommended. C:\Documents and Settings\thirt\Personal\Visual Studio 2005\WebSites\funnelreport\FunnelReportViewer.aspx 19 46 C:\...\funnelreport\

Error 2 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Documents and Settings\thirt\Personal\Visual Studio 2005\WebSites\funnelreport\Default.aspx.vb 2

Error 3 'Theme' is not a member of 'ASP.default_aspx'. C:\Documents and Settings\thirt\Personal\Visual Studio 2005\WebSites\funnelreport\Default.aspx 1

Error 4 'InitializeCulture' is not a member of 'ASP.default_aspx'. C:\Documents and Settings\thirt\Personal\Visual Studio 2005\WebSites\funnelreport\Default.aspx 1

Error 5 'CreateResourceBasedLiteralControl' is not a member of 'ASP.default_aspx'. C:\Documents and Settings\thirt\Personal\Visual Studio 2005\WebSites\funnelreport\Default.aspx 10

Error 6 '_Default' is ambiguous. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\funnelreport\4c49bd6a\8176d0c2\App_Web__d_xzwfu.6.vb 71

Error 7 Class 'default_aspx' must implement 'ReadOnly Property IsReusable() As Boolean' for interface 'System.Web.IHttpHandler'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\funnelreport\4c49bd6a\8176d0c2\App_Web__d_xzwfu.6.vb 72

Error 8 Class 'default_aspx' must implement 'Sub ProcessRequest(context As HttpContext)' for interface 'System.Web.IHttpHandler'. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\funnelreport\4c49bd6a\8176d0c2\App_Web__d_xzwfu.6.vb 72

I have a total of 17 errors, but again, can't make the connection how it's related to the change I just made. And Ideas?

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Fri 13 Jul 2007 18:16

I created a new site, created a new connection string that uses a specific scheme "Plus", assigned it to a new gridview and using the gridview data source wizard for the table tblprojreqsummary, adding the primary Key field and a few others.

Select: SELECT [fldprindexno], [fldprprojectno], [fldprprojectindexno], [fldprname], [fldprstatus], [fldprstatusreason], [fldprpluspm], [fldprfiletype], [fldprprob], [fldprprobwork] FROM [tblprojreqsummary]

But I still can't click on ADVANCE and select the options to auto generate the Update, Insert and Delete statements. UGH!!!

I included the table definition above in an earlier post. You said you could get the generate code option to work. Can you do me a huge favor and paste in here the Update SQL that was generated for this table?

It fine if it tries to update all fields. I just need to see how to make an update query using parameters that works for Postgres. My end result update SQL will just be used to update the fields fldprprobwork and fldprprob.

Thanks!!

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Fri 13 Jul 2007 19:37

Here's the current Update SQL that I use for MS SQL Server in VS2005:

UPDATE plus.tblprojreqsummary SET fldprprob = @fldprprob, fldprprobwork = @fldprprobwork WHERE (fldprindexno = @fldprindexno)

When I try to use this with the connection string to Postgres, I get the following error on update:

Exception Details: CoreLab.PostgreSql.PgSqlException: Parameter name is missing.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[PgSqlException (0x80004005): Parameter name is missing.]


Hope that clears up my problem and goal.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Sat 14 Jul 2007 06:40

Which component do you use? SqlDataSource or PgSqlDataSource? Try to use the second one.
Here is the update command for it:

Code: Select all

UPDATE "tblprojreqsummary" SET "fldprprojectno" = ?, "fldprprojectindexno" = ?, "fldprname" = ?, "fldprstatus" = ?, "fldprstatusreason" = ?, "fldprdatecreated" = ?, "fldprdatesubmitted" = ?, "fldprcomplexid" = ?, "fldprdesignbuild" = ?, "fldprponum" = ?, "fldprpoamt" = ?, "fldprpluspm" = ?, "fldprapprovedby" = ?, "fldpradminapproveby" = ?, "fldprforecastapproveby" = ?, "fldprparentproject" = ?, "fldprmasterprojid" = ?, "fldprtype" = ?, "fldprfiletype" = ?, "fldprautocad" = ?, "fldprcadlead" = ?, "fldprprob" = ?, "fldprprobwork" = ?, "fldprsitework" = ?, "fldprmemo" = ?, "fldprcompanyid" = ?, "fldprcompanysiteid" = ?, "fldpraddressid" = ?, "fldprbillingnameid" = ?, "fldprclientpm" = ?, "fldprbillingcontactid" = ?, "fldprcontracttype" = ?, "fldprinvoicefreq" = ?, "fldprterms" = ?, "fldprspecialinvoice" = ?, "fldprratesched" = ?, "fldprrateschedother" = ?, "fldprrateschedmaster" = ?, "fldprtotalcont" = ?, "fldprcreatedby" = ?, "flddelstartdate" = ?, "fldprtotalequip" = ?, "fldprtotaleng" = ?, "fldprtotalexp" = ?, "fldprtotalsub" = ?, "fldprtotalproject" = ?, "fldprcontractsigner" = ?, "fldedmsoption" = ?, "fldedmskeepinmaster" = ?, "fldprtotalcontamt" = ? WHERE "fldprindexno" = ?

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Sat 14 Jul 2007 15:04

Thanks alot! I'm pretty sure I'm using PgSLdatasource. I'm heading into work later and will test that out.

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Sat 14 Jul 2007 18:41

ok, I was able to simplify the update SQL to meet my needs:
UPDATE tblprojreqsummary SET fldprprob = ?, fldprprobwork = ? WHERE fldprindexno = ?

However, after specifying this Update SQL in the data source wizard for the gridview I get the error: Error Invoking 'configure data source..' Details: Index was out of range. Must be non-negative and less then the size of the collection. Paramter name: index

When I look at the source of the gridview I'm apply this data source to, I see:

"
ProviderName="" SelectCommand="SELECT fldprindexno, fldprprojectno, fldprprojectindexno, fldprname, fldprstatus, fldprpluspm, fldprprob, fldprprobwork FROM plus.tblprojreqsummary WHERE (fldprpluspm = 1434) AND (fldprstatus = 'C')"
UpdateCommand="UPDATE tblprojreqsummary SET fldprprob = ?, fldprprobwork = ? WHERE fldprindexno = ?
">


Maybe this is more of a VS2005 question now, unless you see something I'm screwing up.

But when I look at the data source using MS SQL is see:

"
SelectCommand="SELECT [probindexno], [probdesc] FROM [tlkpprobtypes] ORDER BY [probindexno]"
UpdateCommand="UPDATE tblprojreqsummary SET fldprprob = @fldprprob, fldprprobwork = @fldprprobwork WHERE (fldprindexno = @fldprindexno)">






So do I need to define the parameters?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 16 Jul 2007 09:34

We are investigating this problem...

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Mon 16 Jul 2007 13:51

Thanks, I''ll also let you know if I find out anything on my side. Look forward to your response.

tomhirt
Posts: 36
Joined: Mon 02 Jul 2007 17:50

Post by tomhirt » Mon 16 Jul 2007 15:13

found this article: ms-help://MS.VSCC.v80/CoreLab.PostgreSql/PgSQLDirect/Parameters.html

I like he concept of using the named paramters as I better understand that.

So I have updated my Update sql to read:
UpdateCommand="UPDATE plus.tblprojreqsummary SET fldprprob = :fldprprob, fldprprobwork = :fldprprobwork WHERE fldprindexno = @fldprindexno">

And I no longer get the Index out of range error.

However, on the update page, I get an error as it's looking for a paramter:
Exception Details: CoreLab.PostgreSql.PgSqlException: Parameter name is missing.

So back in the gridview update source, I'm trying to figure out how to specify the paramters. But I can't seem to use what the above link recoments for named paramters.

their example:
[Visual Basic]

Dim pgSqlCommand1 as PgSqlCommand
...
pgSqlCommand1.CommandText = "UPDATE dept SET dname = :dname, loc = :loc WHERE deptno = @deptno"
pgSqlCommand1.Parameters.Add("@deptno", 20)
pgSqlCommand1.Parameters.Add("dname", "SALES")
pgSqlCommand1.Parameters.Add("loc", "NEW YORK")

Any ideas

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 17 Jul 2007 10:51

I've answered this question by e-mail. Please take a look.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 17 Jul 2007 11:17

tomhirt wrote:Error Invoking 'configure data source..' Details: Index was out of range. Must be non-negative and less then the size of the collection. Paramter name: index
We have fixed this problem.
Look forward to the release of PostgreSQLDirect .NET v3.20.

diego.elias
Posts: 1
Joined: Fri 30 Nov 2007 15:40

Parameter name is missing OR could not determine data type of parameter

Post by diego.elias » Fri 30 Nov 2007 15:48

I need help in two scenarios: The First scenario is a test, the Second scenario is exacly what i need.

"
InsertCommand="INSERT INTO billing.dre_catalog(service_catalog_id, name, price, install, investiment_cost, recurent_cost, install_cost, dre_city_id, telco_id, bandwidth_id, active) VALUES (:service_catalog_id, :name, :price, :install, :investiment_cost, :recurent_cost, :install_cost, :dre_city_id, :telco_id, :bandwidth_id, :active)"
ProviderName=""
SelectCommand="SELECT dre_catalog_id, service_catalog_id, name, price, install, investiment_cost, recurent_cost, install_cost, dre_city_id, telco_id, bandwidth_id, active FROM billing.dre_catalog WHERE (dre_catalog_id = :dre_catalog_id)"
UpdateCommand="UPDATE "dre_catalog" SET "active" = ? WHERE "dre_catalog_id" = ?">






















If i use this scenario, i get the error "Parameter name is missing".




"
InsertCommand="INSERT INTO billing.dre_catalog(service_catalog_id, name, price, install, investiment_cost, recurent_cost, install_cost, dre_city_id, telco_id, bandwidth_id, active) VALUES (:service_catalog_id, :name, :price, :install, :investiment_cost, :recurent_cost, :install_cost, :dre_city_id, :telco_id, :bandwidth_id, :active)"
ProviderName=""
SelectCommand="SELECT dre_catalog_id, service_catalog_id, name, price, install, investiment_cost, recurent_cost, install_cost, dre_city_id, telco_id, bandwidth_id, active FROM billing.dre_catalog WHERE (dre_catalog_id = :dre_catalog_id)"
UpdateCommand="UPDATE billing.dre_catalog SET service_catalog_id = :service_catalog_id, name = :name, price = :price, install = install, investiment_cost = :investiment_cost, recurent_cost = :recurent_cost, install_cost = :install_cost, dre_city_id = :dre_city_id, telco_id = :telco_id, bandwidth_id = :bandwidth_id, active = :active WHERE (dre_catalog_id = :dre_catalog_id)">































If i use this scenario, i get the error "could not determine data type of parameter $11".


Please, i need some help fast :( I'm stopped because this...

SecureGen
Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Post by SecureGen » Mon 03 Dec 2007 11:49

Please send me a small test project to reproduce the problem.
Include the definition of your own database objects.
Use e-mail address provided in the Readme.html file.
Do not use third party components.

Post Reply