Search found 27 matches
- Wed 25 Nov 2009 12:09
- Forum: dotConnect for MySQL
- Topic: Transaction isolation level can't be changed while a transac
- Replies: 1
- Views: 5311
fixed
Fixed by installing latest version, and increasing connection timeout
- Tue 24 Nov 2009 16:25
- Forum: dotConnect for MySQL
- Topic: Transaction isolation level can't be changed while a transac
- Replies: 1
- Views: 5311
Transaction isolation level can't be changed while a transac
Hi,
The following error is killing me: do you guys have any idea whatsoever what is happening ?
I'm just simply saving and retrieving simple information from our database using devart linq2sql, i'm not trying to set any transaction level or whatsoever.
This errors occurs randomly, but since i've disabled the query log in mysql (which made the server very slow), it now occurs less often.
-------------------------------------
Server Error in '/' Application.
Transaction isolation level can't be changed while a transaction is in progress
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Devart.Data.MySql.MySqlException: Transaction isolation level can't be changed while a transaction is in progress
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:
[MySqlException (0x80004005): Transaction isolation level can't be changed while a transaction is in progress]
Devart.Data.MySql.ai.o() +167
Devart.Data.MySql.ai.c() +108
Devart.Data.MySql.u.a(ae[]& A_0, Int32& A_1) +84
Devart.Data.MySql.u.a(Byte[] A_0, Int32 A_1, Boolean A_2) +76
Devart.Data.MySql.a4.e() +125
Devart.Data.MySql.a4.o() +36
Devart.Data.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3) +865
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +178
System.Data.Common.DbCommand.ExecuteReader() +12
Devart.Common.DbCommandBase.ExecuteNonQuery() +34
Devart.Data.MySql.MySqlTransaction..ctor(MySqlConnection A_0, IsolationLevel A_1) +164
Devart.Data.MySql.MySqlInternalConnection.BeginTransaction(IsolationLevel il) +38
Devart.Common.DbConnectionBase.BeginDbTransaction(IsolationLevel isolationLevel) +12
System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel) +10
Devart.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +468
[ProviderException: An exception occurred. Please contact your administrator.]
Devart.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +1031
System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258
System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132
System.Configuration.SettingsBase.get_Item(String propertyName) +102
System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
System.Web.Profile.ProfileBase.get_Item(String propertyName) +68
System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) +7
ProfileCommon.get_firstname() +11
_usermanagement_Default.btn_edit_Click(Object sender, EventArgs e) +329
_usermanagement_Default.btn_add_Click(Object sender, EventArgs e) +70
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
The following error is killing me: do you guys have any idea whatsoever what is happening ?
I'm just simply saving and retrieving simple information from our database using devart linq2sql, i'm not trying to set any transaction level or whatsoever.
This errors occurs randomly, but since i've disabled the query log in mysql (which made the server very slow), it now occurs less often.
-------------------------------------
Server Error in '/' Application.
Transaction isolation level can't be changed while a transaction is in progress
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Devart.Data.MySql.MySqlException: Transaction isolation level can't be changed while a transaction is in progress
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:
[MySqlException (0x80004005): Transaction isolation level can't be changed while a transaction is in progress]
Devart.Data.MySql.ai.o() +167
Devart.Data.MySql.ai.c() +108
Devart.Data.MySql.u.a(ae[]& A_0, Int32& A_1) +84
Devart.Data.MySql.u.a(Byte[] A_0, Int32 A_1, Boolean A_2) +76
Devart.Data.MySql.a4.e() +125
Devart.Data.MySql.a4.o() +36
Devart.Data.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3) +865
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +178
System.Data.Common.DbCommand.ExecuteReader() +12
Devart.Common.DbCommandBase.ExecuteNonQuery() +34
Devart.Data.MySql.MySqlTransaction..ctor(MySqlConnection A_0, IsolationLevel A_1) +164
Devart.Data.MySql.MySqlInternalConnection.BeginTransaction(IsolationLevel il) +38
Devart.Common.DbConnectionBase.BeginDbTransaction(IsolationLevel isolationLevel) +12
System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel) +10
Devart.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +468
[ProviderException: An exception occurred. Please contact your administrator.]
Devart.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +1031
System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258
System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132
System.Configuration.SettingsBase.get_Item(String propertyName) +102
System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
System.Web.Profile.ProfileBase.get_Item(String propertyName) +68
System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) +7
ProfileCommon.get_firstname() +11
_usermanagement_Default.btn_edit_Click(Object sender, EventArgs e) +329
_usermanagement_Default.btn_add_Click(Object sender, EventArgs e) +70
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
- Wed 04 Mar 2009 13:55
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Disconnected model: error updating childobject in DB
- Replies: 4
- Views: 3630
All problems solved with latest version
Hi,
Thanks for your time, but i've installed the latest version and removed all old Dll's from my system.
Everything works fine now !
Thanks for your time, but i've installed the latest version and removed all old Dll's from my system.
Everything works fine now !
- Tue 03 Mar 2009 16:00
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Disconnected model: error updating childobject in DB
- Replies: 4
- Views: 3630
small update2
Please check my old topic at
http://devart.com/forums/viewtopic.php?p=41604#41604
(about attaching childobjects to a parentobject and insert them in one move)
This does not seem to work either.
The intellisense does not prompt me for the .add method
example:
http://devart.com/forums/viewtopic.php?p=41604#41604
(about attaching childobjects to a parentobject and insert them in one move)
This does not seem to work either.
The intellisense does not prompt me for the .add method
example:
Code: Select all
Parentobject.childobjects.add(chilobject)
- Tue 03 Mar 2009 15:26
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Disconnected model: error updating childobject in DB
- Replies: 4
- Views: 3630
update
I've tried to manually retrieve the parent object (walnumber) to attach it to the childobject like this:
But that gives me the following error:
Code: Select all
employee.Walnumber = walnumber;
in other words:
childboject.parentobject = parentobject
Code: Select all
Line 6528: set
Line 6529: {
Line 6530: Walnumber previousValue = this._Walnumber.Entity;
Line 6531: if (((previousValue != value)
Line 6532: || (this._Walnumber.HasLoadedOrAssignedValue == false)))
- Tue 03 Mar 2009 15:20
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Disconnected model: error updating childobject in DB
- Replies: 4
- Views: 3630
Disconnected model: error updating childobject in DB
Hi Forum,
Please help me out: maybe i'm making a mistake or maybe i found an error.
I have two tables: tblParent (walnumber) and tblChild (employee)
tblChild has a foreign key relationship to tblParent.
When i try to update the tblChild the following way:
I get the following error:
So it seems that the datacontext cannot update a child relaction to the database when the parent table that is referenced is not loaded into the datacontext.
Is that by design or am i doing something wrong ?
Please help me out: maybe i'm making a mistake or maybe i found an error.
I have two tables: tblParent (walnumber) and tblChild (employee)
tblChild has a foreign key relationship to tblParent.
When i try to update the tblChild the following way:
Code: Select all
Employee employee = Employee.GetSingleByPrimaryKey(grid_employees.SelectedDataKey.Value.ToString());
using (umbrellaDataContext.umbrellaDataContext db = new umbrellaDataContext.umbrellaDataContext())
{
db.Employees.Attach(employee);
employee.Betweenfix = txt_e_infix.Text;
employee.Email = txt_e_email.Text;
employee.Faxnumber = txt_e_fax.Text;
employee.Firstname = txt_e_firstname.Text;
employee.Lastname = txt_e_lastname.Text;
employee.Telephone_Celluar = txt_e_celluar.Text;
employee.Telephone_Office = txt_e_officenumber.Text;
employee.Title = txt_e_title.Text;
db.SubmitChanges();
}
Code: Select all
Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.
Source Error:
Line 6524: get
Line 6525: {
Line 6526: return this._Walnumber.Entity;
Line 6527: }
Line 6528: set
Is that by design or am i doing something wrong ?
- Wed 18 Feb 2009 15:57
- Forum: LinqConnect (LINQ to SQL support)
- Topic: querying many-2-many relations with cross reference table.
- Replies: 1
- Views: 2624
querying many-2-many relations with cross reference table.
Hi Forum,
I've read that it was possible to use LINQ query's to query data from cross reference tables without having to reference the crosstable itself in the linq query. Here is an example:
Table1: Employees
PK: employeeid
Table2: Cross reference between Employees and Roles
FK: employeeid
FK: roleid
Table3:
PK roleid
------------
i would like to query something like
var employees = from e in db.employees.where(e => e.employees.roles.rolename.contains(xxx)..
But i cannot make this work, does anyone has any tips ?
Thanks in advance,
Yuri.
I've read that it was possible to use LINQ query's to query data from cross reference tables without having to reference the crosstable itself in the linq query. Here is an example:
Table1: Employees
PK: employeeid
Table2: Cross reference between Employees and Roles
FK: employeeid
FK: roleid
Table3:
PK roleid
------------
i would like to query something like
var employees = from e in db.employees.where(e => e.employees.roles.rolename.contains(xxx)..
But i cannot make this work, does anyone has any tips ?
Thanks in advance,
Yuri.
- Fri 31 Oct 2008 11:19
- Forum: dotConnect for MySQL
- Topic: Linq2Mysql 1.00.2 beta - Visual Studio Code Analysis
- Replies: 2
- Views: 2229
- Fri 31 Oct 2008 11:11
- Forum: dotConnect for MySQL
- Topic: linq extentions (delete multiple rows, dynamic linq queries)
- Replies: 3
- Views: 3216
- Mon 27 Oct 2008 14:20
- Forum: dotConnect for MySQL
- Topic: utf8
- Replies: 3
- Views: 2755
Yes,
Use in the connectionstring instead of
Use
Code: Select all
unicode=True
Code: Select all
charset=utf-8
- Mon 27 Oct 2008 11:03
- Forum: dotConnect for MySQL
- Topic: linq extentions (delete multiple rows, dynamic linq queries)
- Replies: 3
- Views: 3216
linq extentions (delete multiple rows, dynamic linq queries)
Hi,
Linq is great, but it also introduces a few problems. It would be great to have a set of extentions to the default devart classes.
Example 1: When we want to delete multiple rows, we first have to have retreive the objects from the database, so that we can delete them. This is unneccesary I/O.
Sollution: http://forums.microsoft.com/MSDN/ShowPo ... 4&SiteID=1
Example 2: Building dynamic LINQ queries: When we want to use multiple AND / OR operators in a linq query, based on a stringcollection as an input, you can use the predicatebuilder.
Sollution: http://www.albahari.com/nutshell/predicatebuilder.aspx
Linq is great, but it also introduces a few problems. It would be great to have a set of extentions to the default devart classes.
Example 1: When we want to delete multiple rows, we first have to have retreive the objects from the database, so that we can delete them. This is unneccesary I/O.
Sollution: http://forums.microsoft.com/MSDN/ShowPo ... 4&SiteID=1
Example 2: Building dynamic LINQ queries: When we want to use multiple AND / OR operators in a linq query, based on a stringcollection as an input, you can use the predicatebuilder.
Sollution: http://www.albahari.com/nutshell/predicatebuilder.aspx
- Mon 27 Oct 2008 10:06
- Forum: dotConnect for MySQL
- Topic: linq2mysqlbeta: Method 'ToLower' in linq query does not work
- Replies: 1
- Views: 2044
linq2mysqlbeta: Method 'ToLower' in linq query does not work
Hi,
When i pass a CultureInfo in "ToLower" method in a linq query, i get the following exception: "Method 'ToLower' has no supported translation to SQL.".
Code example:
Stack Trace:
[NotSupportedException: Method 'ToLower' has no supported translation to SQL.]
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.g(MethodInfo A_0) +81
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.h(MethodInfo A_0) +5010
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.GetServerMethodsForMethod(MethodInfo m) +471
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +841
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +161
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.a(j A_0) +65
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(j A_0) +152
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +136
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +144
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +88
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Type A_1, SqlNode A_2, ReadOnlyCollection`1 A_3) +251
Devart.Data.Linq.Provider.DataProvider.a(Expression A_0) +247
Devart.Data.Linq.Provider.DataProvider.f(Expression A_0) +168
Devart.Data.Linq.DataQuery`1.i() +53
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +247
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +81
umbrellaDataContext.Walnumber.GetByConditions(String searchCriteria, String walnumbertypePK) in C:\data\websites\umbrella.wallie.com\umbrellaDataContext\Walnumber.cs:20
_retailsettings_default.bindRetailers() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:32
_retailsettings_default.bindData() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:26
_retailsettings_default.Page_Load(Object sender, EventArgs e) in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:19
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
When i pass a CultureInfo in "ToLower" method in a linq query, i get the following exception: "Method 'ToLower' has no supported translation to SQL.".
Code example:
Code: Select all
CultureInfo ci = new CultureInfo("nl-NL");
var walnumbers = from w in db.Walnumbers.Where(w => w.Name.ToLower(ci).Contains(searchCriteria)
[NotSupportedException: Method 'ToLower' has no supported translation to SQL.]
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.g(MethodInfo A_0) +81
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.h(MethodInfo A_0) +5010
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.GetServerMethodsForMethod(MethodInfo m) +471
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +841
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +161
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.a(j A_0) +65
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(j A_0) +152
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +136
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +144
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +88
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Type A_1, SqlNode A_2, ReadOnlyCollection`1 A_3) +251
Devart.Data.Linq.Provider.DataProvider.a(Expression A_0) +247
Devart.Data.Linq.Provider.DataProvider.f(Expression A_0) +168
Devart.Data.Linq.DataQuery`1.i() +53
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +247
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +81
umbrellaDataContext.Walnumber.GetByConditions(String searchCriteria, String walnumbertypePK) in C:\data\websites\umbrella.wallie.com\umbrellaDataContext\Walnumber.cs:20
_retailsettings_default.bindRetailers() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:32
_retailsettings_default.bindData() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:26
_retailsettings_default.Page_Load(Object sender, EventArgs e) in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:19
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
- Mon 27 Oct 2008 07:58
- Forum: dotConnect for MySQL
- Topic: Linq2Mysql 1.00.2 beta - Visual Studio Code Analysis
- Replies: 2
- Views: 2229
Linq2Mysql 1.00.2 beta - Visual Studio Code Analysis
Hi,
When i build my sollution with Code Analysis enabled (all options turned on except 'Naming rules', i very often see these kind of warnings:
It refers to a relationship between two tables, this is the code:
Can you please tell me what this is about ?
Should i supress these messages?
When i build my sollution with Code Analysis enabled (all options turned on except 'Naming rules', i very often see these kind of warnings:
Code: Select all
Warning 28 CA2227 : Microsoft.Usage : Change 'Country.Eans' to be read-only by removing the property setter.
Code: Select all
[Association(Name="Country_Ean", Storage="_Eans", OtherKey="Countryfk")]
public EntitySet Eans
{
get
{
return this._Eans;
}
set
{
this._Eans.Assign(value);
}
}
Should i supress these messages?
- Fri 17 Oct 2008 10:05
- Forum: dotConnect for MySQL
- Topic: linq2sql beta: insert parent/child rows in one submitchanges
- Replies: 3
- Views: 3633
workaround
The workaround i mentioned does not work
I currently am using two submitchanges() to insert parent and child records, ofcourse not a good thing because it all should be done in one transaction.
I currently am using two submitchanges() to insert parent and child records, ofcourse not a good thing because it all should be done in one transaction.
- Tue 14 Oct 2008 12:40
- Forum: dotConnect for MySQL
- Topic: linq2sql beta: insert parent/child rows in one submitchanges
- Replies: 3
- Views: 3633
linq2sql beta: insert parent/child rows in one submitchanges
Hi,
I've tried to insert parent and child rows in one db.submitchanges(), the childobject has a foreign key relationship to the parentobject
Like this:
As described here : http://forums.microsoft.com/MSDN/ShowPo ... 1&SiteID=1
But that doesnt't work, i cannot add a childobject to a parentobject.
My workaround at the moment is the following:
It is important to add the childobject first, otherwise a FK relationship error is thrown.
I've tried to insert parent and child rows in one db.submitchanges(), the childobject has a foreign key relationship to the parentobject
Like this:
Code: Select all
ParentObject po = new ParentObject();
ChildObject co = new ChildObject();
po.Childobjects.add(co);
db.ParentObjects.insertOnSubmit(po);
db.SubmitChanges();
But that doesnt't work, i cannot add a childobject to a parentobject.
My workaround at the moment is the following:
Code: Select all
childobject.insertonsubmit(co);
parentobject.insertonsubmit(po);
db.submitchanges();