Search found 20 matches

by drichter
Thu 18 Mar 2010 15:07
Forum: dotConnect for PostgreSQL
Topic: IndexOutOfRangeException during select
Replies: 1
Views: 1334

IndexOutOfRangeException during select

This exception happens very rarely and only on the first request to the instantiated DataContext...

Any ideas?


Version:
4.55.42.0

Code:

Code: Select all

dbUser = db.Users.SingleOrDefault(p => p.Username == userName);

Stacktrace:

Code: Select all

   bei System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   bei Devart.Data.Linq.Provider.DataSourceInfo.TypeSystemProvider.GetProviderType(String typeName)
   bei Devart.Data.Linq.Provider.Query.SqlFactory.Default(MetaDataMember member)
   bei Devart.Data.Linq.Provider.Query.ar.a(d A_0, MetaType A_1, List`1& A_2, List`1& A_3, SqlExpression& A_4, IList`1 A_5)
   bei Devart.Data.Linq.Provider.Query.ar.b(d A_0, MetaType A_1, List`1& A_2, List`1& A_3, SqlExpression& A_4, IList`1 A_5)
   bei Devart.Data.Linq.Provider.Query.ar.a(d A_0, IList`1 A_1)
   bei Devart.Data.Linq.Provider.Query.ar.a(MetaType A_0, ITable A_1, IList`1 A_2)
   bei Devart.Data.Linq.Provider.Query.ar.a(bh A_0)
   bei Devart.Data.Linq.h.a(bh A_0, List`1 A_1)
   bei Devart.Data.Linq.h.a(MetaDataMember A_0, bh A_1, List`1 A_2)
   bei Devart.Data.Linq.Provider.g.b.a(q A_0)
   bei Devart.Data.Linq.Provider.g.b.a(SqlExpression A_0)
   bei Devart.Data.Linq.Provider.g.b.b(SqlExpression A_0)
   bei Devart.Data.Linq.Provider.g.a(f A_0, SqlExpression A_1)
   bei Devart.Data.Linq.Provider.g.a(Type A_0, SqlExpression A_1, f A_2, p A_3)
   bei Devart.Data.Linq.Provider.DataProvider.c.a(Int32 A_0)
   bei Devart.Data.Linq.Provider.DataProvider.a(c A_0, f A_1, IDbConnection A_2, IDataReader A_3)
   bei Devart.Data.Linq.Provider.DataProvider.a(c A_0, f A_1, Object[] A_2, Object[] A_3, Object A_4)
   bei Devart.Data.Linq.Provider.DataProvider.a(c A_0, Object[] A_1)
   bei Devart.Data.Linq.Provider.DataProvider.h(Expression A_0)
   bei Devart.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
   bei System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
   bei MyCharityUserService.UserService.GetUser(Nullable`1 userID, String userName) in D:\xxxx\UserService.cs:Zeile 181.
   bei SyncInvokeGetUser(Object , Object[] , Object[] )
   bei System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   bei System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
by drichter
Tue 10 Nov 2009 13:45
Forum: dotConnect for PostgreSQL
Topic: DataLoadOptions
Replies: 1
Views: 1391

Got it myself..

was missing a reference to System.Data.Linq library..
by drichter
Tue 10 Nov 2009 12:46
Forum: dotConnect for PostgreSQL
Topic: DataLoadOptions
Replies: 1
Views: 1391

DataLoadOptions

Code: Select all

            Devart.Data.Linq.DataLoadOptions dlo = new Devart.Data.Linq.DataLoadOptions();
            dlo.LoadWith(p => p.Storeratings);
This code is actually throwing an intellisense error like:

Code: Select all

Cannot implicitly convert type 'System.Data.Linq.EntitySet' to 'object'	
Regarding to this example it should work like above:

http://msdn.microsoft.com/en-us/library ... dwith.aspx
by drichter
Thu 01 Oct 2009 13:10
Forum: dotConnect for PostgreSQL
Topic: The value cannot be NULL.\r\nParametername: input
Replies: 5
Views: 1843

Thanks!
by drichter
Wed 30 Sep 2009 08:09
Forum: dotConnect for PostgreSQL
Topic: how to connect to multiple databases during run time
Replies: 4
Views: 2554

Hi,

no guarantee for correctness:

2. An entity itself does not have a unique connection-string. Only it's DataContext has...

3. If they're identical this would'nt make sense.. just instantiate the same with another ConnectionString..

4. I guess you want to read data from one database and commit it to another? Mhm... very interesting question...
This would be a cool thing to create a 100% data-identical database..
by drichter
Sun 27 Sep 2009 14:06
Forum: dotConnect for PostgreSQL
Topic: The value cannot be NULL.\r\nParametername: input
Replies: 5
Views: 1843

i found out why the update is not working...

When iam using the partial of the method "UpdateXXX" like this, it's not updating anything:

Code: Select all

    public partial class DataContext
    {
        partial void UpdateStore(Store instance)
        {
            instance.Seo_unique_keystring = Tools.GetUniqueStoreSeoString(instance, "");
        }
    }
this way it's working:

Code: Select all

    public partial class DataContext
    {
        /*partial void UpdateStore(Store instance)
        {
            instance.Seo_unique_keystring = Tools.GetUniqueStoreSeoString(instance, "");
        }*/
    }
Why is this? I really go crazy with this "undocumented" behaviour of this LINQ stuff...

btw. if iam adding a "this.SubmitChanges();" below the update of the instance i get a "StackOverflowException" in "mscorlib.dll"..
by drichter
Sat 26 Sep 2009 21:18
Forum: dotConnect for PostgreSQL
Topic: Updating a relation?
Replies: 2
Views: 1486

Updating a relation?

Hi,

iam trying to update a FK-relation like below...

If iam REMOVING the "SubmitChanges()" in the line that i've marked below, the set of "a.Calculated_bid_price" throws an error during the "SubmitChanges() at the bottom"...

the field "Calculated_bid_price" is not related to the "new_relation_entity"..


I really don't understand why this happens? Can you explain the logic here?

Code: Select all

            Entity_Table_XXX a = GetTable();
            Entitiy_YYY new_relation_entity = GetNewRealtionEntity();

            a.Relation_Entity= new_relation_entity;
            db.SubmitChanges(); // If i remove this line, the error with "calculated_bid_price" occurs

            a.Calculated_bid_price = a.Calculated_bid_price + 1;
            db.SubmitChanges();
by drichter
Fri 25 Sep 2009 09:21
Forum: dotConnect for PostgreSQL
Topic: The value cannot be NULL.\r\nParametername: input
Replies: 5
Views: 1843

Ok, now i recreated the entity of that table in the entity developer and now there is now error anymore, but NO UPDATE to the table ( which is even worse )...

When iam investigating at the DataContext, i can see the changed values of the row i changed..

When i call "SubmitChanges()" now, there is no error or something but also no update to the database...

When iam looking at the Logoutput of the DataContext.Log there are only "select-statements" in it, but no UPDATE statement...

So?

Edit: Updates on other tables are still working... Updates via SQL-Editor are also working, so no SQL error or something
by drichter
Fri 25 Sep 2009 08:51
Forum: dotConnect for PostgreSQL
Topic: The value cannot be NULL.\r\nParametername: input
Replies: 5
Views: 1843

The value cannot be NULL.\r\nParametername: input

I get an error like this:

The value cannot be NULL.\r\nParametername: input

on a create or an update on a single table via SubmitChanges() ( other tables are working )...


Any ideas?




Stacktrace:

Code: Select all

   bei Devart.Data.Linq.v.b(MetaType A_0, q A_1, Boolean A_2)
   bei Devart.Data.Linq.a.a(c A_0, Object A_1, ModifiedMemberInfo[] A_2, Boolean A_3)
   bei Devart.Data.Linq.k.a(a A_0, c A_1, Boolean A_2)
   bei Devart.Data.Linq.k.a(DataContext A_0, ConflictMode A_1)
   bei Devart.Data.Linq.k.b(DataContext A_0, ConflictMode A_1)
   bei Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
   bei Common.DB.BaseModel.Save() in DD:\XXXX\DB\BaseModel.cs:Zeile 34.
   bei Common.DB.StoreModel.CreateStore(Store s) in D:\XXXX\StoreModel.cs:Zeile 40.
   bei WebApp.Controllers.AccountController.Register(String firstName, String lastName, String email, String emailConfirm, String password, String confirmPassword, String usertype, String accesscode, String captcha) in D:\XXXX\AccountController.cs:Zeile 206.
by drichter
Tue 22 Sep 2009 13:40
Forum: dotConnect for PostgreSQL
Topic: Devart.Data.PostgreSql.PgSqlCommand InvalidCastException
Replies: 3
Views: 1611

Ähm, how would i do that?
by drichter
Tue 22 Sep 2009 09:36
Forum: dotConnect for PostgreSQL
Topic: Devart.Data.PostgreSql.PgSqlCommand InvalidCastException
Replies: 3
Views: 1611

Devart.Data.PostgreSql.PgSqlCommand InvalidCastException

When executing a query like this:

Code: Select all

// Store is a linq-entity
Store store = db.Stores.SingleOrDefault(s => s.Fk_user.Equals(userid));
iam receiving ( never had this before ) a:

The object of type "Devart.Data.PostgreSql.PgSqlCommand" cannot be casted to "Devart.Data.PostgreSql.PgSqlCommand".

Stacktrace:

Code: Select all

[InvalidCastException: Das Objekt des Typs "Devart.Data.PostgreSql.PgSqlCommand" kann nicht in Typ "Devart.Data.PostgreSql.PgSqlCommand" umgewandelt werden.]
   Devart.Data.PostgreSql.Linq.Provider.PgSqlDataProvider.CreateCommand(String commandText, IDbConnection connection) +100
   Devart.Data.Linq.Provider.DataProvider.a(c A_0, f A_1, Object[] A_2, Object[] A_3, Object A_4) +269
   Devart.Data.Linq.Provider.DataProvider.a(c A_0, Object[] A_1) +137
   Devart.Data.Linq.Provider.DataProvider.h(Expression A_0) +191
   Devart.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute(Expression expression) +53
   System.Linq.Queryable.SingleOrDefault(IQueryable`1 source, Expression`1 predicate) +301
   Common.DB.StoreModel.GetStore(String userid) in C:\Projects\Common\Common\DB\StoreModel.cs:84
   WebApp.Models.CommonWebMethods.SetSessionStoreInfos(HttpSessionStateBase session) in C:\Projects\WebApp\Models\CommonWebMethods.cs:85
   WebApp.Models.CommonWebMethods.CreateSessionInitials(HttpSessionStateBase session, String userName) in C:\Projects\WebApp\Models\CommonWebMethods.cs:78
   WebApp.Controllers.AccountController.Register(String firstName, String lastName, String email, String emailConfirm, String password, String confirmPassword, String usertype, String accesscode, String captcha) in C:\Projects\WebApp\Controllers\AccountController.cs:197
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +667
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.c__DisplayClassa.b__7() +52
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
   System.Web.Mvc.c__DisplayClassc.b__9() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
   System.Web.Mvc.Controller.ExecuteCore() +126
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +27
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +151
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Any ideas?

Thanks.
by drichter
Mon 07 Sep 2009 15:55
Forum: dotConnect for PostgreSQL
Topic: Update on a "Auto Generated Value=true" field
Replies: 3
Views: 1876

Iam setting the "Auto generated Value" property for the field "status" in the entity-designer to "true" ( for my table-entity )...

Now, LINQ knows that this field shouldn't be set to "null", but to be chopped off from the insert into command .. means:

What LINQ is doing with status -> auto-generated-value=true:
-> insert into xyz ( description ) values ( "test" )
---> status value set to the default value (e.g. "created" )

What LINQ is doing with status -> auto-generated-value=false:
-> insert into xyz ( description, status ) values ( "test", null )
------> status value set to null


So, now i need to update the status field for whatever reason...

And you say that's not possible with the framework? That means that's is impossible to use the databases "default" feature?!

Well, for my understanding that'd be a bug then...
by drichter
Fri 04 Sep 2009 10:09
Forum: dotConnect for PostgreSQL
Topic: Update on "boolean" not working when using SubmitChanges()
Replies: 2
Views: 1506

Actually, i found out that these fields are also "auto generated values", like i mentioned in this topic: http://www.devart.com/forums/viewtopic. ... 58aa8da7d5

so, this is the actual problem here..

Thanks.
by drichter
Fri 04 Sep 2009 08:58
Forum: dotConnect for PostgreSQL
Topic: Performance
Replies: 4
Views: 1683

Perform the data-access like this, and LINQ will generate a select whith the "key" field in the where clause, instead of grabbing the whole table first.

PurchaseOrder single = dataContext.PurchaseOrders.Single(c => c.Key == key));
by drichter
Fri 04 Sep 2009 08:51
Forum: dotConnect for PostgreSQL
Topic: Update on a "Auto Generated Value=true" field
Replies: 3
Views: 1876

Update on a "Auto Generated Value=true" field

Hi,

i realized that an update on a field, declared like this, is not commited.

How am i supposed to make an update on a field like "state", which has a "defaultvalue=created" property set in the database?

I want the defaultvalue to be used, but also the possibility to update it later..

THanks for any advice