Hello
I have a couple general usage questions about the context file.
Which of the following do I use in my web application design?
--1 Context per page request
--1 Context per session
--multiple contexts per page request
--1 static context for server
Also, is it required for me to call the Dispose() method of the context when I am through with it, or are the database connections handled in some other fashion?
Thank You,
Andrew
Search found 9 matches
- Tue 14 Jul 2009 20:34
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Context File
- Replies: 1
- Views: 2130
- Tue 28 Apr 2009 22:13
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Linq OrderByDescending slow
- Replies: 1
- Views: 2944
Linq OrderByDescending slow
Hello.
I have noticed that adding an OrderByDescending to the end of a linq query adds about 90ms of time. Is this just the overhead of linq? Or is there something wrong? The equivalent query in sql runs much quicker.
Thanks
Andrew
I have noticed that adding an OrderByDescending to the end of a linq query adds about 90ms of time. Is this just the overhead of linq? Or is there something wrong? The equivalent query in sql runs much quicker.
Thanks
Andrew
- Thu 23 Apr 2009 19:38
- Forum: dotConnect for MySQL
- Topic: Upgrade Devart, can't login to asp.net project
- Replies: 1
- Views: 1924
- Thu 23 Apr 2009 18:38
- Forum: dotConnect for MySQL
- Topic: Upgrade Devart, can't login to asp.net project
- Replies: 1
- Views: 1924
Upgrade Devart, can't login to asp.net project
Hi all,
When I try to upgrade to the new version of devart, everything compiles and runs fine until I try to login to my application, which is using Form authentication.
Help!
Thanks
Andrew[/code]
When I try to upgrade to the new version of devart, everything compiles and runs fine until I try to login to my application, which is using Form authentication.
Code: Select all
Server Error in '/' Application.
Cannot convert parameter value of type 'System.String' to MySQL type 'MySqlType.TimeStamp'.
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.InvalidCastException: Cannot convert parameter value of type 'System.String' to MySQL type 'MySqlType.TimeStamp'.
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:
[InvalidCastException: Cannot convert parameter value of type 'System.String' to MySQL type 'MySqlType.TimeStamp'.]
Devart.Data.MySql.MySqlParameter.a() +217
Devart.Data.MySql.ax.a(Int32& A_0, ArrayList& A_1) +2517
Devart.Data.MySql.a1.e() +209
Devart.Data.MySql.a1.o() +31
Devart.Data.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3) +873
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +193
System.Data.Common.DbCommand.ExecuteReader() +9
Devart.Common.DbCommandBase.ExecuteNonQuery() +53
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, Object[] A_1) +761
[ProviderException: An exception occurred. Please contact your administrator.]
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, Object[] A_1) +824
Devart.Common.Web.Providers.DbMembershipProvider.ValidateUser(String username, String password) +260
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
Thanks
Andrew[/code]
- Wed 28 Jan 2009 18:26
- Forum: dotConnect for MySQL
- Topic: Problem with Upgrade
- Replies: 1
- Views: 1744
Problem with Upgrade
Hello
I just upgraded to 5.00.2 and ran into a problem.
Apparently my session is no longer working. I get this error no matter what page I am on. Any advice would be appreciated.
Thanks
Andrew
I just upgraded to 5.00.2 and ran into a problem.
Code: Select all
Server Error in '/' Application.
Cannot convert parameter value of type 'System.Int32' to MySQL type 'MySqlType.Time'.
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.InvalidCastException: Cannot convert parameter value of type 'System.Int32' to MySQL type 'MySqlType.Time'.
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:
[InvalidCastException: Cannot convert parameter value of type 'System.Int32' to MySQL type 'MySqlType.Time'.]
Devart.Common.Web.Providers.DbSessionStateStore.CreateUninitializedItem(HttpContext context, String id, Int32 timeout) +1097
System.Web.SessionState.SessionStateModule.CreateUninitializedSessionState() +44
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +594
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +90
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
Thanks
Andrew
- Wed 19 Nov 2008 22:15
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Linq with Null values
- Replies: 9
- Views: 5376
Linq with Null values
Hello
I was wondering if support for nullable fields will be added.
For example, I have a field in the MySQL database of Decimal type. This type can be null. The shema modeller reflects this but the code generated does not.
I noticed a new version of Linq has been provided but have not been able to upgrade yet. So sorry if this fix has already been implemented.
Thanks
AFrieze
I was wondering if support for nullable fields will be added.
For example, I have a field in the MySQL database of Decimal type. This type can be null. The shema modeller reflects this but the code generated does not.
I noticed a new version of Linq has been provided but have not been able to upgrade yet. So sorry if this fix has already been implemented.
Thanks
AFrieze
- Fri 19 Sep 2008 20:23
- Forum: dotConnect for MySQL
- Topic: Linq: Problem with Multi-column primary key. MultiKeyManager
- Replies: 2
- Views: 3959
Shalex
Sorry about forgetting the client table. Here it is.
The project no longer has this error as I have programmed around it with a one column primary key. I can try to replicate it again if it would be helpful to you.
Thanks!
Andrew
Sorry about forgetting the client table. Here it is.
Code: Select all
DROP TABLE IF EXISTS `findlocation`.`client`;
CREATE TABLE `findlocation`.`client` (
`client_id` int(10) unsigned NOT NULL auto_increment,
`client_name` varchar(45) NOT NULL,
`xionetic_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=956 DEFAULT CHARSET=latin1;
Thanks!
Andrew
- Tue 16 Sep 2008 22:26
- Forum: dotConnect for MySQL
- Topic: Linq: Problem with Multi-column primary key. MultiKeyManager
- Replies: 2
- Views: 3959
Linq: Problem with Multi-column primary key. MultiKeyManager
Hello.
I have a problem that I believe stems from the use of two columns as the primary key. Whenever I try to query the table with linq; i get this error:
And here is the SQL Create statement for my table:
Any ideas?
Thanks!
AFrieze
P.s. Really enjoying linq!
I have a problem that I believe stems from the use of two columns as the primary key. Whenever I try to query the table with linq; i get this error:
Code: Select all
[InvalidOperationException: Sequence contains no matching element]
System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +320
Devart.Data.Linq.MultiKeyManager`2.a() +309
Devart.Data.Linq.MultiKeyManager`2.a(Type A_0) +491
Devart.Data.Linq.MultiKeyManager`2.a(Type A_0) +230
Devart.Data.Linq.MultiKeyManager`2.CreateDefault() +264
Devart.Data.Linq.MultiKeyManager`2.a(T A_0) +125
Devart.Data.Linq.Provider.EntityReader`2.a() +70
Devart.Data.Linq.Provider.ObjectReader`1.MoveNext() +22
FindLocationLib.XioneticClasses.DBUtil.GetXioneticUserByUserId(String userId) in C:\Develop\FindLocationDevelop\FindLocationLib\XioneticClasses\DBUtil.cs:24
FindLocation.Login.Login1_LoggedIn(Object sender, EventArgs e) in C:\Develop\FindLocationDevelop\FindLocation\Login.aspx.cs:34
System.Web.UI.WebControls.Login.OnLoggedIn(EventArgs e) +105
System.Web.UI.WebControls.Login.AttemptLogin() +205
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
And here is the SQL Create statement for my table:
Code: Select all
DROP TABLE IF EXISTS `findlocation`.`fluser`;
CREATE TABLE `findlocation`.`fluser` (
`user_id` varchar(45) NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`parent_id` varchar(45) default NULL,
PRIMARY KEY (`user_id`,`client_id`),
KEY `FK_fluser_1` (`client_id`),
CONSTRAINT `FK_fluser_1` FOREIGN KEY (`client_id`) REFERENCES `client` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Any ideas?
Thanks!
AFrieze
P.s. Really enjoying linq!
- Thu 28 Aug 2008 20:32
- Forum: dotConnect for MySQL
- Topic: Linq Beta and AutoIncrement fields
- Replies: 4
- Views: 3650
Linq Beta and AutoIncrement fields
Hi all
I am experimenting with Linq and the Schema Modeller. I have a database id field that is an AutoIncrement field.
I can successfully insert a new row with linq, but the object is not updated with the id.
Example:
In the Schema Modeller these attributes are set:
Access: Public
Delay Loaded: False
Inheritance Modifier: None
Name: client_id
Type: System.Int64
Auto Generated Value: True
Auto-Sync: OnInsert
Is Version: False
Nullable: False
Primary Key: True
Read Only: False
Server Data Type: int(10) Not Null Auto_increment
Source: client_id
Update Check: Always
Any ideas on why the id field is not synced on my object after the submit?
Thanks!
Andrew
[/code]
I am experimenting with Linq and the Schema Modeller. I have a database id field that is an AutoIncrement field.
I can successfully insert a new row with linq, but the object is not updated with the id.
Example:
Code: Select all
client c = new client { client_name = clRow["name"].ToString() };
//client has an auto increment field called client_id
db.clients.InsertOnSubmit(c);
db.SubmitChanges();
Console.Write("client_id = " + c.client_id); //client_id is 0
In the Schema Modeller these attributes are set:
Access: Public
Delay Loaded: False
Inheritance Modifier: None
Name: client_id
Type: System.Int64
Auto Generated Value: True
Auto-Sync: OnInsert
Is Version: False
Nullable: False
Primary Key: True
Read Only: False
Server Data Type: int(10) Not Null Auto_increment
Source: client_id
Update Check: Always
Any ideas on why the id field is not synced on my object after the submit?
Thanks!
Andrew
[/code]