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!