subsonic / SubSonic-3.0
- Source
- Commits
- Network (131)
- Issues (63)
- Downloads (4)
- Graphs
-
Branch:
master
-
1 comment Created 5 months ago by jchannonError in ExpressionVisitor.cs - VisitUnary when doing a NOT IN expressionAcceptedxTo replicate this try the following
List excluded = new List();
var f = WebPageContent.Find(x => !usedID.Any(e => e == x.ID));I know there is nothing in the list but in my scenario I have a list that might get populated so I need to do a Find then a Delete. I have tried doing just a Delete for less code and less DB hitss but there is a bug in the Delete lambda expression when doing a NOT IN type scenario. See Github issue 62.
At the moment I am having to do this:
if (usedID.Count > 0)
{ var f = WebPageContent.Find(x => !usedID.Any(e => e == x.ID));
if (f.Count > 0) { var repo = WebPageContent.GetRepo(); repo.Delete(f); }}
I should just be able to do WebPageContent.Delete(x => !usedID.Any(e => e == x.ID));
Comments
-
Grave "accents" incorrect with MySql provider
1 comment Created 4 months ago by shawiiing3.0.0.3 SimpleRepository issue with MySQL Server 5.1 and .Net Connector 6.0.4
var p = repo.GetPaged(index, pagesize)
Throws a MySQL syntax exception when run. After doing some digging (getting the logs to work) this is the query that is being executed:
SELECT COUNT(``id``) AS `CountOfid` FROM Sales; //Does not work
SELECT COUNT(id) AS CountOfid FROM Sales; //Ran this to make sure it wasn't an issue in the DB and it runs like a champ.
Comments
Ok so got brave and downloaded the source and hacked my own fix.
Looks like removing all of the grave characters (`) in the method below resolves the issue. I need to do more testing to make sure they weren't in there for a reason.
The method in question is:
protected override string GenerateAggregateSelect(Aggregate aggregate) -
Lambda Parameter not in scope when using SimpleRepository Find
2 comments Created 4 months ago by matwareI have this simple little method that is trying to use the SimpleRepositry Find method in SubSonic 3.0.0.3. When I make the call I get a invalid operation exception "Lambda Parameter not in scope".
To reproduce this fault I used the following code :class SimpleCustomer
{ /// <summary> /// Gets or sets the customer GUID. /// </summary> /// <value>The customer GUID.</value> public Guid CustomerGUID { get; set; } /// <summary> /// Gets or sets the ID tag number that is assigned to the customer /// </summary> /// <value>The ID.</value> public string ID { get; set; } public bool Active { get; set; } /// <summary> /// Gets or sets the first names. /// </summary> /// <value>The first names.</value> public string FirstNames { get; set; } /// <summary> /// Gets or sets the last names. /// </summary> /// <value>The last names.</value> public string LastNames { get; set; } } public static void AddSimpleCustomer() { SimpleRepository repos = new SimpleRepository("EmptyDB", SimpleRepositoryOptions.RunMigrations); string searchTerm = "jon"; string id = "00033221100"; SimpleCustomer x = new SimpleCustomer(); if (repos.Exists<SimpleCustomer>(c => c.ID == id) == false) { x.FirstNames = "John"; x.LastNames = "Smith"; x.ID = id; x.CustomerGUID = Guid.NewGuid(); repos.Add<SimpleCustomer>(x); } // Boom - Thinks go horribly wrong here SimpleCustomer y = repos.Find<SimpleCustomer>(c => c.FirstNames.StartsWith(searchTerm)).FirstOrDefault(); //Or Here y = repos.Find<SimpleCustomer>(c => c.FirstNames.Contains(searchTerm)).FirstOrDefault(); }I can work around this issue using
public override IEnumerable FindCustomers(string searchTerm)
{ return Repos.All<Customer>().Where(cust => cust.FirstNames.Contains(searchTerm) || cust.LastNames.Contains(searchTerm)).ToArray(); }But given that it is using the All method, I suspect that this may not scale well :-)
Comments
I added support for StartsWith/EndsWith recently - can you pull the latest source and tell me what happens? Also - All() is just IQueryable so your workaround is the same query.
Thanks for that, I checked out the latests version, and still no dice, and I've got to say sorry, the way it worked was to do
return Repos.All().ToArray().Where(cust => cust.FirstNames.Contains(searchTerm) || cust.LastNames.Contains(searchTerm)).ToArray();I must have had one too many beers and not transcribed my code correctly. The result is that we are querying an in memory buffer, rather than user the glory of SQL.
-
ActiveRecord crashes when updating table with Computed Column (mssql, pull)
1 comment Created 4 months ago by awbackerActiveRecord attempts to update computed columns in sql server. This effectively means that any table with a computed column can not be used.
These two commits add awareness of Computed columns, to the templates and the core.
- Computed columns can still be updated in code
- Core will not try to update/insert a column that is computed
In the future, it should make computed column property "protected set" , and not add them to the dirty columns collection.
http://github.com/awbacker/SubSonic-3.0/commit/e8141cffb4c5a6c22269f402c7e08dcfc8ff6c23
http://github.com/awbacker/SubSonic-3.0-Templates/commit/d32b69f8f4a484c77567207a071f0caa46038701Sorry about the CS files in there, don't know what to do bout that since I am so new to GIT.
Comments
-
MediumTrust SecurityException on when pulling from DB.[Table]
0 comments Created 4 months ago by nathanbThere are some issues with the current trunk and invoking the datacontext.[Tables]. Count() or .Where(). I tried testing this today. My code is using trunk/master subsonic and active record templates from today (8/7/2009 @ 6PM CST)
Saving, getting, and deleting a single row worked fine in MediumTrust. When I tried to do a DB.Table.Where(o=> expression).ToList(); I got the SecurityException below. (this also happened when trying to pull all rows with a simple LINQ query. (from row in DB.Tables select row);
I don't have any suggestions yet. I believe this is happening on a Compile() function; possibly where the expression tree is constructed??? I haven't dug into it yet.
Error: System.MethodAccessException: System.Runtime.CompilerServices.StrongBox
1..ctor(System.__Canon) ---> System.Security.SecurityException: Request failed.<br/> at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)<br/> at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)<br/> at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)<br/> at System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh)<br/> at System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh)<br/> at System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)<br/> at System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)<br/> at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext)<br/> at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant)<br/> The action that failed was:<br/> Demand<br/> The type of the first permission that failed was:<br/> System.Security.PermissionSet<br/> --- End of inner exception stack trace --- at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)<br/> at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)<br/> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)<br/> at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)<br/> at System.Linq.Expressions.ExpressionCompiler.AddGlobal(Type type, Object value)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateConstant(ILGenerator gen, Type type, Object value, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateConstant(ILGenerator gen, ConstantExpression c, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateArgs(ILGenerator gen, ParameterInfo[] pis, ReadOnlyCollection1 args)
at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodInfo mi, ReadOnlyCollection1 args, Type objectType)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodCallExpression mc, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateConvert(ILGenerator gen, UnaryExpression u)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateConditional(ILGenerator gen, ConditionalExpression b)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateMemberAssignment(ILGenerator gen, MemberAssignment binding, Type objectType)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateBinding(ILGenerator gen, MemberBinding binding, Type objectType)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateMemberInit(ILGenerator gen, ReadOnlyCollection1 bindings, Boolean keepOnStack, Type objectType)
at System.Linq.Expressions.ExpressionCompiler.GenerateMemberInit(ILGenerator gen, MemberInitExpression init)
at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)
at System.Linq.Expressions.ExpressionCompiler.GenerateLambda(LambdaExpression lambda)
at System.Linq.Expressions.ExpressionCompiler.GenerateCreateDelegate(ILGenerator gen, LambdaExpression lambda)
at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)
at System.Linq.Expressions.ExpressionCompiler.GenerateArgs(ILGenerator gen, ParameterInfo[] pis, ReadOnlyCollection1 args)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateNew(ILGenerator gen, NewExpression nex, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateArgs(ILGenerator gen, ParameterInfo[] pis, ReadOnlyCollection1 args)
at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodInfo mi, ReadOnlyCollection1 args, Type objectType)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodCallExpression mc, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateArgs(ILGenerator gen, ParameterInfo[] pis, ReadOnlyCollection1 args)
at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodInfo mi, ReadOnlyCollection1 args, Type objectType)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateMethodCall(ILGenerator gen, MethodCallExpression mc, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateConvert(ILGenerator gen, UnaryExpression u)<br/> at System.Linq.Expressions.ExpressionCompiler.Generate(ILGenerator gen, Expression node, StackType ask)<br/> at System.Linq.Expressions.ExpressionCompiler.GenerateLambda(LambdaExpression lambda)<br/> at System.Linq.Expressions.ExpressionCompiler.CompileDynamicLambda(LambdaExpression lambda)<br/> at System.Linq.Expressions.Expression1.Compile()
at SubSonic.Linq.Structure.DbQueryProvider.Execute(Expression expression)
at SubSonic.Linq.Structure.QueryProvider.System.Linq.IQueryProvider.Execute(Expression expression)
at SubSonic.Linq.Structure.Query1.GetEnumerator()<br/> at System.Collections.Generic.List1..ctor(IEnumerable1 collection)<br/> at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)Comments
-
SimpleRepository: The name "False" is not permitted in this context.
0 comments Created 4 months ago by JerichoSteps to reproduce:
- Using SimpleRository and SQL server as you backend, create a C# class and run a Subsonic migration. This will create the corresponding table on the SQL server
- Add a non-nullable Boolean field to the C# class and run migration again
Expected behavior
You expect a new Bit field to be added to the SQL table and also all the existing records to be updated with the value '0' in the new field.
Observed behavior
The new field is not created and the following error is thrown:
Message: The name "False" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. Source: .Net SqlClient Data Provider Stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at SubSonic.Query.BatchQuery.ExecuteTransaction() in F:\Users\Jericho\Documents\Visual Studio 2008\Projects\SubSonic 3 Source\SubSonic-3.0\SubSonic.Core\Query\BatchQuery.cs:line 198
Cause of the problem
On line 220 in ANSISchemaGenerator.cs, the default value is set to the boolean value "false":
column.DefaultSetting = false;The result is the following query (notice the default value is set to 'False'):
ALTER TABLE [MyTests] ADD MyBooleanTestColumn bit NOT NULL CONSTRAINT DF_Visits_MyBooleanTestColumn DEFAULT (False)However, the underlying SQL table field is a 'bit' and therefore the accepted values are 0 or 1.
Solution
Change line 220 in Sql2005Schema.cs from:
column.DefaultSetting = false;To:
column.DefaultSetting = 0;Comments
- Using SimpleRository and SQL server as you backend, create a C# class and run a Subsonic migration. This will create the corresponding table on the SQL server
-
SubSonic.Query.Insert error caused by MakePlural
1 comment Created 4 months ago by carloskleinI am using activerecord (last subsonic source, with MySQL) and my table name is Payment. SubSonic generates a Payment class. Great! Almost everything works. One exception is SubSonic.Query.Insert, who calls the ToSchemaTable (there is a call to MakePlural there). As result, a obtain a wrong sql command, with Payments.
How a im doing:
SubSonic.Query.BatchQuery batch = new BatchQuery(); var query = new SubSonic.Query.Insert(provider).Into<Payment>(new String[] { "Number", "Document", "ServiceNumber", "PaymentDate", "FreeDate" }) .Values(new Object[] { payment.Number, payment.Document, payment.ServiceNumber, payment.PaymentDate.ToString("yyyy-MM-dd HH:mm:ss"), payment.FreeDate.Value.ToString("yyyy-MM-dd HH:mm:ss") }); batch.Queue(query); batch.Execute();Comments
westernmonster
Fri Dec 18 06:57:42 -0800 2009
| link
I have the same problem.
-
ActiveRecord: calling Find() on column that allows nulls results in incorrect SQL
3 comments Created 4 months ago by BatteryManWhen I call Find() on a column that allows nulls, SubSonic is generating incorrect SQL. This happens only when I call Find() from a VB.NET project (SubSonic + templates are in a separate C# project in the same solution). If I call Find() from a C# project, there is no problem.
Details:
- latest SubSonic 3 (master branch, dated 2009-07-27) and ActiveRecord
- MS SQL Server 2005 Express Edition.
- Visual Studio 2008 solution
- SubSonic and T4 templates in a C# class library project
- My VB application in a separate project referencing the SubSonic project
Here's my table:
CREATE TABLE [dbo].[Fruit]( [FruitID] [int] NOT NULL, [ColorID] [int] NULL, CONSTRAINT [PK_Fruit] PRIMARY KEY CLUSTERED ...In my VB code, I have
Dim bar = Fruit.Find(Function(f As Fruit) f.ColorID = 1)SubSonic generates the following SQL
SELECT [t0].[ColorID], [t0].[FruitID] FROM [dbo].[Fruit] AS t0 WHERE ([t0].[ColorID] = 1) <> 0which fails to execute in DBDataProvider.ExecuteReader with
SqlException was unhandled by user code Incorrect syntax near '<'If I make the ColorID column "NOT NULL", the query generates correctly as:
SELECT [t0].[ColorID], [t0].[FruitID] FROM [dbo].[Fruit] AS t0 WHERE ([t0].[ColorID] = 1)If I execute the following equivalent Find() in C#, I also have no problems:
var foo = FooDB.Fruit.Find(x => x.ColorID == 1);Please let me know if you need more information. If there are any workarounds that I can use until this makes it in, I'd appreciate it.
Comments
My beloved VB.NET wraps an UnaryExpression around the expression f.ColorID = 1 so that it becomes (f.ColorID = 1) <> False. At which point, this confuses the TSqlFormatter or something along the line. Am investigating now to track down a good solution to this problem.
Apocatastasis
Fri Nov 20 12:17:46 -0800 2009
| link
In the meantime, how I can use Subsonic in a VB.NET project? Is C# or nothing for now?
Unfortunately, it is not ideal for VB.NET
I've started attempting to track down how to fix the quirks with LINQ and VB.NET but I've recently had all my free time used up with the birth of my first child two months ago.
Tis funny how the introduction of a baby to the house everything changes. -
Connections being left open after inserting a record
0 comments Created 4 months ago by InnerSphereUsing 3.0.0.3 and also tried w/ rebuild from the latest @ github
Replicated by the following code in MySql and Advanced TemplatesEDIT: Appears to be solved by the solution presented by kamsar
http://github.com/subsonic/SubSonic-3.0/issues#issue/69Dim v2Context = New SS.v2DB Dim repo = New SubSonic.Repository.SubSonicRepository(Of SS.administrator)(v2Context) For i As Integer = 1 To 1000 Dim admin = New SS.administrator admin.Username = Guid.NewGuid.ToString admin.Password = Guid.NewGuid.ToString admin.LastLogin = Now repo.Add(admin) NextMySql Query Log Shows:
62 Connect someuser@localhost on v2 62 Query SHOW VARIABLES 62 Query SHOW COLLATION 62 Query SET character_set_results=NULL 62 Init DB v2 62 Query INSERT INTO `administrator`(`Username`,`Password`,`LastLogin`) VALUES ('a70fd381-e436-449a-96b3-afc3bb1d7481','2f8696c9-fb09-4cf5-b515-fc9b24ded7e7','2009-08-15 21:55:02');SELECT LAST_INSERT_ID() as newidAnd so on for each insert until the connections pile up and choke the pool causing a timeout.
Same thing happens if using ActiveRecord templates.
For i As Integer = 1 To 5 Dim a As New AR.administrator a.Username = Guid.NewGuid.ToString a.Password = Guid.NewGuid.ToString a.LastLogin = Now a.Save() Next iHowever, performing an insert using the code below properly opens/closes the connection:
Dim b = New SubSonic.Query.BatchQuery(v2Context.DataProvider) For i As Integer = 1 To 1000 Dim ins = v2Context.Insert.Into(Of SS.administrator)( _ Function(x) x.Username, _ Function(x) x.Password, _ Function(x) x.LastLogin) _ .Values(Guid.NewGuid.ToString, Guid.NewGuid.ToString, Now.ToString("yyyy-MM-dd")) b.QueueForTransaction(ins) Next b.ExecuteTransaction()Comments
-
In the current master branch (dated 2009-07-27), boolean values values always return false. This does NOT occur with the SubSonic 3.0.0.3.
Details:
- latest SubSonic 3 (master branch, dated 2009-07-27) and ActiveRecord
- MS SQL Server 2005 Express Edition
- Occurs in C# and VB
Here's my table:
CREATE TABLE [dbo].[Fruit]( [FruitID] [int] NOT NULL, [IsAwesome] [bit] NOT NULL, CONSTRAINT [PK_Fruit] PRIMARY KEY CLUSTERED ( ...and my table data:
(FruitID, IsAwesome) (1, True) (2, False)Here's my code:
string s = ""; var list = FooDB.Fruit.All(); foreach (var f in list) { s = s + f.IsAwesome + " "; } MessageBox.Show(s);When I execute this with the current master branch of SubSonic, I get:
False FalseWhen I execute this with 3.0.0.3
True FalseComments
BatteryMan
Tue Sep 01 09:59:24 -0700 2009
| link
Does not occur with current SubSonic commits. This can be closed.
-
varbinary not returned by Subsonic Query, always set to null
0 comments Created 4 months ago by KaarelI have a column in SQL Server 2005 table of type varbinary(MAX). Generated active record class has the corresponding property type byte[]. I can successfully new-up the active record class representing the table, initialize values and save. The static method Find of the active record class returns the full set of data. When using the SubSonic.Linq.Structure.Query<T> then the byte[] field is always null.
In other words
var query = new Query<MyTable>();
var result = (from x in query select x).ToList();if MyTable has a property of type byte[] (varbinary(MAX) in SQL Server 2005) then that property is always null in the result.
Comments
-
The member 'xxx' is not supported error when using GUID as Find parameter
2 comments Created 4 months ago by jamesewelchWhen querying using a GUID, the following error is returned:
The member 'xxx' is not supported. (xxx is the property name)
Example code:
Guid myId = new Guid("EE4FB3A9-2039-40FC-8241-F97967CF38A1");
IList test = Document.Find(x => x.xxx == myId);Comments
jamesewelch
Fri Aug 28 10:45:16 -0700 2009
| link
Might this be the problem?
http://stackoverflow.com/questions/1325592/subsonic-3-linq-join-problems/1343416#1343416
this is a available in my forked version of the source and I have also notified Rob to merge the branch back into the trunk.
else if (m.Member.MemberType == System.Reflection.MemberTypes.Property)
{ // this logic block is to allow for a reflected property to be used in the where clause. // Kenneth Carter 10/30/2009 sb.Append(m.Member.Name); return m; } -
Database values aren't loaded into all fields
4 comments Created 4 months ago by jamesewelchI have various columns that aren't loading into my objects. None of the columns that are affected by naming changes resulting from my modified CleanUp method are being loaded. In this function, I'm just replacing underscores with string.empty and fixing the capitalization back like SubSonic 2.x, so "my_table" becomes "MyTable". The fields that weren't affected (other than capitalization changes) load fine.
Comments
have you change Subsonic.Core.dll for your modification? I think you have to change there as well
jamesewelch
Thu Aug 20 14:10:26 -0700 2009
| link
I haven't changed Subsonic.Core. I only changed CleanUp to remove underscores and fix capitalizations.
Maybe that is the problem, somehow subsonic.core need reference from classes that is created by activerecord t4 templates. both of these have to synchronize one to another...IMO
For example like this, http://github.com/funky81/SubSonic-3.0/tree/d73482c27d46602cbd105344ca28c4516c3c5d30/SubSonic.Core/Linq/Structure/ImplicitMapping.cs , please check line number 103
jamesewelch
Fri Aug 28 10:41:12 -0700 2009
| link
Discussed further at http://stackoverflow.com/questions/1324716/subsonic-3-activerecord-issues-blank-data
-
Error Using subsonic for group by query in vb.net
0 comments Created 4 months ago by tuanvtHello, I have a table called QuizItem that have these fields
id As Int
created As DateTime
header As Sring
body As String
fk_parent As int
url As StringAll the items without parent key would be the question, and ones that have the parent key would be the answer. I am having the problem to get all the latest active questions (based both on questions created time and and answer created time).
I have used the following approach to do the query but keep getting the error or wrong result( answer and questions in diffrent group), is there some issue with the subsonic vb template, or my code is wrong, or sth else, any one can help me please.
From q In Quiz.Data.QuizItem.All Group q By masterID = If(q.FK_Parent Is Nothing, q.ID, q.ID) Into g = Group _
Order By g.Max(Function(q2) q2.Created) Descending Select New With {.masterItem = (From q3 In g Where q3.FK_Parent Is Nothing Select q3).Single}Any idea is appreciated
Comments
-
public IQueryable Find(Expression<Func<T, bool>> expression)
in TestRepository returns all records, making unit tests which rely on the Active Record Testing using Find or SingleOrDefault fail.
Comments
I am having the same problem and it makes it IMPOSSIBLE to test... This line of code:
var dbFriend = Friend.SingleOrDefault(f => f.UserId == id && f.FriendId == friendId);Always returns the first element regardless of whether the expression is matched or not. This happens because of
var results=repo.Find(expression);in the ActiveRecord.cs file.
I tried to step through it but couldn't figure it out.
My table looks like this:
FriendUserId - unique, bigint, auto increment
FriendId - big int
UserId - big inI also noticed that the autoincrement features doesn't work in test mode. Is that correct behavior?
I'm having the same issue when using the Test Repository. When I change the tests to use a test database, I have no issues. I would love to see this fixed as I'd rather not use a database for testing.
@eibrahim: Autoincrement isn't supposed to work with the Test Repo according to the answer given by rob here -> http://stackoverflow.com/questions/1508706/
-
MySQL.Data 5.1.7.0, BOOL aka tinyint and ParameterMarker
0 comments Created 4 months ago by cssWhat lead me down this road was the BOOL/TINYINT/SByte problem mentioned in issue #Num: #95 Figuring out the same as defacer.
After some digging around I find this: http://lists.mysql.com/commits/79014
And decide to try update MySQL.Data, I was using 5.2.5 iirc. I tried only 5.2.7 and 5.1.7 (and 5.2.5).
I got the same TINYINT -> SByte problem in all but 5.1.7. In the latter I now figure out that the ParameterMarker is ? and DbDataProvider.cs:104 ExecuteReader(QueryCommand qry) throws on /SubSonic.Core/DataProviders/DbDataProvider.cs#L130. saying "Column 'XYZ' cannot be null", even if parameters are added to the command. I found http://forums.mysql.com/read.php?38,200568,200573#msg-200573 and added "old syntax=true" in my connection string. Now instead I get a bunch of warnings for every query (I assume):[23.08.2009 11:28:39] - WARNING:You are using old syntax that will be removed in future versions
coupled with
A first chance exception of type 'System.ArgumentException' occurred in System.Core.dll
stemming from SubSonic.Core/Linq/Structure/QueryMapping.cs#L159 in Output tool window.
I ask what have I done wrong? Do I not deserve SubSonic???
Comments
-
MySqlConversionException:
{"Unable to convert MySQL date/time value to System.DateTime"} " at MySql.Data.Types.MySqlDateTime.GetDateTime()"CREATE TABLE
bugdatetime(
idINT NOT NULL AUTO_INCREMENT , PRIMARY KEY (id)
);INSERT INTO
bugdatetime(id) VALUES (NULL );ALTER TABLE
bugdatetime
ADDCreatedOnDATETIME NOT NULL;The first row should have all 0's (CSV export for example):
"1";"0000-00-00 00:00:00"Run Template tool, try bugdatetime.SingleOrDefault( x => x.id == 1 ); <- throws.
Implementation of
GetDateTime:/// <summary>Returns this value as a DateTime</summary> public DateTime GetDateTime() { if (!IsValidDateTime) throw new MySqlConversionException("Unable to convert MySQL date/time value to System.DateTime"); return new DateTime(year, month, day, hour, minute, second); }Implementation of
IsValidDateTime():/// <summary> /// Indicates if this object contains a value that can be represented as a DateTime /// </summary> public bool IsValidDateTime { get { return year != 0 && month != 0 && day != 0; } }Now this is silly, who is MySQL to tell ME what I consider an invalid datetime value!
Comments
-
SubSonicPrimaryKey attribute does not stack with SubSonicStringLength attribute
0 comments Created 4 months ago by Dangph- Delete the Products table from an Sqlite3 database.
- Run the following code. This will add a Product to the Products table, creating the table in the process.
Result: The MyID field will have type nvarchar. Expected: MyID should have type nvarchar(10).
namespace ss3simple {
}class Product { [SubSonicPrimaryKey] [SubSonicStringLength(10)] public string MyID { get; set; } [SubSonicStringLength(11)] public string Value { get; set; } public Product(string a, string b) { MyID = a; Value = b; } public Product() { } } class Program { static void Main(string[] args) { var repo = new SimpleRepository(SimpleRepositoryOptions.RunMigrations); repo.Add(new Product("hi", "there")); } }
Comments
- Delete the Products table from an Sqlite3 database.
-
Using SQLite v3 and ActiveRecord pattern.Created a table named "User.Categories". When the T4 template is run, the "." in the name seems to cause a problem with namespaces and therefore class generation.
Comments
jamesewelch
Wed Aug 26 09:09:40 -0700 2009
| link
You need to update the ActiveRecord.tt file's CleanUp method to remove any "." and replace it with string.empty or underscore, etc. You may run into another bug (seee #107), but the CleanUp method will get you past this first hurdle.
I found the CleanUp method in Settings.ttinclude, I'll make the change and see what happens. It would be nice to be able to use periods though...
Thanks!
jamesewelch
Fri Aug 28 10:40:32 -0700 2009
| link
You can't use periods because that's used to separate classes, namespaces, methods, properties, etc. It's a reserved symbol (that's probably not the correct phrase) just like how "*", commas, semicolons, etc. can't be used in a object's name.
-
The line is:
if (col != null) ;
where it should be:
if (col != null)The semi colon is erroneously added.
Comments
-
Anyone having trouble seeing open or all issue within github. Suppose I have several issues display within my dashboard. But when I tried to open, it always gives me empty result. I've tried with Firefox 3, chrome 2/3, and IE 7/8.
Anyone knows how to troubleshoot it ? Or it just github bug?
Comments
For me the same... Also I'm not see all issues in "Open" list.
Right now I'm see "Open (48)", but when I'm go to this tab, there is about 15 issues in list... And no buttons with page numbers or "Next" or something...Maybe we can ask Rob to move forum into somewhere else. I can't see the advantages if we still using github forum like this.
Yeah not sure what is with the no paging for the issues list - been like that forever. There is a google groups list for discussions http://groups.google.com/group/subsonicproject - github is just for confirmed issues and source control. I will agree though that Github's web UI need some love and some optimization - it doesn't load 2/3 of the time and is super slow. As far as moving somewhere else thats how we got here - give Rob a couple months and he'll move to something new and shinier :-) jk Rob
Yes. Exactly the same problem. The site only works properly with FF. Chrome and IE are mostly unusable!!
Most of the issues open completely blank.
-
I need to be able to return a PagedList that is sorted descending by a column. The source code for the function seems to be assuming that ascending will be used. Why does it do that?
Comments
-
Using current build.
Line is:
if (col != null) ;Should be:
if (col != null)Comments
Duplicate issue because I could not see the previous issue.
Here is the original one:
http://github.com/subsonic/SubSonic-3.0/issues/#issue/114I don't see this problem in Update.cs. I did a Find and still can't see it. Not saying it's not there, but this isn't in the current source.
I downloaded the current build just now. The error is still there.
File: Subsonic.Core\Query\Update.cs, Line 230
The semicolon at the end of the line still exists.
You don't have the latest it seems - either that or I'm going crazy. I browsed the source - iit mirrors what's on my hard drive:
How did you "download the source"
Oh my, I was repeatedly downloading from 3.0.0.3 and not master. It was present in that build but the error is resolved in the current build.
I am new to all this, so I apologize for the problem & hope you will pardon my ignorance.
-
Failure to identify Stored Procedure Output Parameter
2 comments Created 3 months ago by CmdrTallenHi using Subsonic 3.0.0.3 and MS SQL 2008 (10.0.2531) it appears there is some issue with Subsonic identifying Stored Procedure paramters as output parameters.
In the StoredProcedures.cs class I find my stored procedure definition but the last parameter is defined incorrectly as a 'AddParameter'.
sp.Command.AddParameter("HasPermission",HasPermission,DbType.Boolean);
When I sp.Execute() and attempt to read the value of the sp.Command.OutputValues[0] the value is null.If the definition is edited to be like this;
sp.Command.AddOutputParameter("HasPermission", DbType.Boolean);
Then the value is returned and is correct value typeI am not sure how I 'fix' this - as everytime I regen the SP class via the 'Run Custom Tool' the parameter definitions require editing. Should I edit a T4 template somehow?
Please advise.
Comments
Having the same issues against 3.0.0.3 and MS SQL Express 2008. Easy to work around, but a more permanent fix would be nice.
-
Issue of QueryMapping.cs,on custom fields or properties
1 comment Created 3 months ago by mamboerThe GetTypeProjection method (line147) will throw an unhandled exception "Type 'System.Collections.Generic.IList`1[System.String]' does not have a default constructor" if i add some custom properties of type like IList{String},when the code runs at "return Expression.MemberInit(Expression.New(type), bindings);".
I think that the GetMappedMembers(type) method should exclude those custom fields and properties,because they don't belong to the ActiveRecord model,they are just custom added for certain biz intentions.
Comments
-
I attempted to make a primary key with UInt64, but no matter what I did it wouldn't run. however when I changed the datatype to long, it worked right on...
what are the datatypes allowed for the primary key?
Comments
-
I tried to find an attribute to disable autoinc key for the primary key, but couldn't find one.
is there a way to disable the auto increment so that I can set the id manually?
thanks!
Comments
-
SQL 2008 comes with the new datatype geography which is currently not supported. It should map to Microsoft.SqlServer.Types.SqlGeography or be converted to a byte array.
Comments
-
NullReferenceException when calling Update method on SimpleRepository
1 comment Created 3 months ago by marektomsaSimpleRepository.Update method throws NullReferenceException when called with non-null arguments.
Following model class:
public class Person { public long ID {get;set;} public string Name { get; set;} }ASP.NET MVC controller action:
[AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection collection) { Person toUpdate = Repository.All<Person>().Single(p => p.ID == id); //is not null, found by ID. TryUpdateModel(toUpdate, collection.ToValueProvider()); //updates model instance successfully. No property of model instance is null Repository.Update(toUpdate); //throws nullreferenceexception return RedirectToAction("Index"); }stack trace:
at SubSonic.Query.Update.GetCommand()
at SubSonic.Query.Update.Execute()
at SubSonic.Repository.SimpleRepository.Update[T](T item)
at MvcApplication1.Controllers.PersonController.Edit(Int32 id, FormCollection collection)
in H:\...\Controllers\PersonController.cs:line 71"No additional information is available in exception details.
My configuration: SubSonic 3, SQLite, empty database
Addtional notes: Querying and saving instances in db works with no problemComments
I think I found the problem here. I was working with it also and found the same issue. It's a comparison issue when the update generator is setting the values for the udpate statement. It makes a comparison between column names where one side is a column name and the other side is the Qualified Column name. I'm committing a patch right now. The only caveat is that the fix may affect other providers.
-
Transaction cannot execute successful with subsonic 3.0.0.3
0 comments Created 3 months ago by AntiGameZMy code follow SubSonic's transaction documentation (reversed TransactionScope and SharedDbConnectionScope).
But I can not commit. Every time a second Save() method execute will throw an InvalidOperationException(already an open datareader).
My environment:
VS 2008, SQL 05/08 (chinese simplified)StackTrace: System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command) +4848228
System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command) +23 System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +144 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +87 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12 System.Data.Common.DbCommand.ExecuteReader() +12 SubSonic.DataProviders.DbDataProvider.ExecuteReader(QueryCommand qry) +375 SubSonic.Repository.SubSonicRepository1.Add(T item, IDataProvider provider) +300 AGZ.MvcTest.Models.User.Add(IDataProvider provider) in D:\Writing - 代码撰写中\NewTech - 新技术测试\AGZ.MvcTest\AGZ.MvcTest\Models\_generated\ActiveRecord.cs:397 AGZ.MvcTest.Models.User.Save(IDataProvider provider) in D:\Writing - 代码撰写中\NewTech - 新技术测试\AGZ.MvcTest\AGZ.MvcTest\Models\_generated\ActiveRecord.cs:412 AGZ.MvcTest.Models.User.Save() in D:\Writing - 代码撰写中\NewTech - 新技术测试\AGZ.MvcTest\AGZ.MvcTest\Models\_generated\ActiveRecord.cs:406 AGZ.MvcTest.Controllers.ScopeTestController.Index() in D:\Writing - 代码撰写中\NewTech - 新技术测试\AGZ.MvcTest\AGZ.MvcTest\Controllers\ScopeTestController.cs:34 lambda_method(ExecutionScope , ControllerBase , Object[] ) +74 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +178 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +24 System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +52 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) +254 System.Web.Mvc.<>cDisplayClassc.b9() +19 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary2 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) +75Comments
-
There is bug in ExecuteScalar method in DbDataProvider class. It always gives weird result if the result from cmd.ExecuteScalar() is null. The result is not null nor in some kind of value. I'm using MySQL template and MySQL Connector 6.1.
So I modified the returned value like this
return result != null & !string.IsNullOrEmpty(result.ToString()) ? result : null;
Comments
-
Subsonic 3 will fail in several scenarios with security exceptions in medium trust.
Steps to reproduce
- Create a 3.5 web application project
- Add connection string for Northwind to web.config
- Set
- Add reference to subsonic.core
- Add ActiveRecord templates to project (namespace modified to Northwind)
Add the following code to Page_Load of default.aspx
var customers = Northwind.Customer.All(); List<Northwind.Customer> list = new List<Northwind.Customer>(); foreach (Northwind.Customer item in customers) { list.Add(item); }View page in browser
Error produced is: System.Security.SecurityException: Request failed.
Replace code in Page_Load with
var db = new Northwind.NorthwindDB(); var customers = from c in db.Customers select c; foreach (var item in customers) { Response.Write(item.CompanyName + "<br/>"); }Recompile and view page
Error produced System.Security.SecurityException: Request failed.
Error occurs in DbQueryProvider
method Execute
statement Func fn = efn.Compile();Seems the compile requires elevated permissions
Comments
- Create a 3.5 web application project
-
Hello,
At the moment types like decimals are being parsed using the current culture by the LINQ parser. This should be done using invariant culture, otherwise you would have to switch to invariant culture before every linq query.
Comments
-
Difference SQLite DateTime between Insert and new Object()
0 comments Created 3 months ago by jswagerThe SQLite database that I use has a table (call it TEST) with a DateTime field (call it DT). Until recently, I have been inserting records into the table by doing the following:
TEST t = new TEST(); TEST.DT = DateTime.Now; TEST.Save();In SQLite (using SQLiteStudio), this will appear something like this: 2009-09-28 16:29:26.4145701.
Recently, I switched to using a different approach, so that I could control the database connection:
Insert.Into(x => x.DT).Values(DateTime.Now).Execute();This appeared to work - no errors on insert. SQLite showed the value differently, as 9/28/2008 1:23 PM. Unfortunately, this difference becomes apparent when the data gets read; when that happens, an exception about converting strings to datetime is thrown.
Expected behavior?
Comments
-
GetPaged needs an index of "1" instead of "0" when using ActiveRecord
0 comments Created 3 months ago by leftendI originally asked a question about this on StackOverflow here: http://stackoverflow.com/questions/1467820/subsonic-getpaged-method-different-index-needed-in-unit-test
Adam thought that this was a bug/inconsistency with the GetPaged method using ActiveRecord, and suggested that I log it here.
Comments
-
Db column not read when the column name contains spaces
1 comment Created 2 months ago by fgalgauI have a SQLServer and a MySQL database having a few columns containing spaces.
The project is correctly generated using T4 templates, the spaces from column names are removed by CleanUp and the project compiles.
However at runtime those columns containg spaces in their names are not read from the db, by using e.g. myTable.GetAll() or any other method.
The debugger will show a SELECT statement where these columns are not present, meaning there is a bug while generating this statment by Subsonic.Core.
Comments
This extends to whenever the name of the Column is changed in any way from that in the database schema (MSSQL confirmed also).
The reason is because by default the system assumes the Property Name is the same as the column name; in fact it conflicts a number of times during query building and during hydration.
I've started a workaround for this which fixes the Selection issue (using the AS keyword for Selection), however haven't got to the Update/Insert issue yet. Not quite comfortable using GIT yet to submit a patch sorry; so here goes:
(PS This may need slight modification for the MySQL overrides etc)== Documented Changes ==
** Structs.tt Find:
<# foreach(var col in tbl.Columns){#>
Columns.Add(new DatabaseColumn("<#=col.Name#>", this) { IsPrimaryKey = <#=col.IsPK.ToString().ToLower()#>, DataType = DbType.<#=col.DbType.ToString()#>, IsNullable = <#=col.IsNullable.ToString().ToLower()#>, AutoIncrement = <#=col.AutoIncrement.ToString().ToLower()#>, IsForeignKey = <#=col.IsForeignKey.ToString().ToLower()#>, MaxLength = <#=col.MaxLength#> });<# }#>
Change to:
<# foreach(var col in tbl.Columns){#>
Columns.Add(new DatabaseColumn("<#=col.Name#>", this) { IsPrimaryKey = <#=col.IsPK.ToString().ToLower()#>, DataType = DbType.<#=col.DbType.ToString()#>, IsNullable = <#=col.IsNullable.ToString().ToLower()#>, AutoIncrement = <#=col.AutoIncrement.ToString().ToLower()#>, IsForeignKey = <#=col.IsForeignKey.ToString().ToLower()#>, MaxLength = <#=col.MaxLength#>, PropertyName = "<#= col.CleanName #>" });<# }#>
** DatabaseTable.cs
Find:
public IColumn GetColumnByPropertyName(string PropertyName) { return Columns.SingleOrDefault(x => x.Name.Equals(PropertyName, StringComparison.InvariantCultureIgnoreCase)); }Change to:
public IColumn GetColumnByPropertyName(string PropertyName) { return Columns.SingleOrDefault(x => x.Name.Equals(PropertyName, StringComparison.InvariantCultureIgnoreCase) || (!String.IsNullOrEmpty(x.PropertyName) && x.PropertyName.Equals(PropertyName, StringComparison.InvariantCultureIgnoreCase))); }** DbExpression.cs
Find:
TableAlias alias; string name; public ColumnExpression(Type type, TableAlias alias, string name) : base(DbExpressionType.Column, type) { this.alias = alias; this.name = name; }Change to:
TableAlias alias; string name; private readonly string memberName; public ColumnExpression(Type type, TableAlias alias, string name) : this(type, alias, name, null) { } public ColumnExpression(Type type, TableAlias alias, string name, string memberName) : base(DbExpressionType.Column, type) { this.alias = alias; this.name = name; this.memberName = memberName; } public string MemberName { get { return this.memberName; } }** TSqlFormatter.cs
Find:
ColumnExpression c = this.VisitValue(column.Expression) as ColumnExpression; if (!string.IsNullOrEmpty(column.Name) && (c == null || c.Name != column.Name)) { sb.Append(" AS "); sb.Append(column.Name); }Change to:
ColumnExpression c = this.VisitValue(column.Expression) as ColumnExpression; if (!string.IsNullOrEmpty(column.Name) && (c == null || c.Name != column.Name)) { sb.Append(" AS "); sb.Append(column.Name); } else if (!String.IsNullOrEmpty(column.Name) && c != null && !String.IsNullOrEmpty(c.MemberName)) { sb.Append(" AS "); sb.Append(c.MemberName); } -
WCF Issue, Active Record's dirty column not properly being set on UPDATE
0 comments Created 2 months ago by legatoA brief intro to teh scenario:
I had created a DAL Library with subsonic 3.0 using default (activerecord.tt and such) .
This library is being consumed by WCF that has been generated using T4.
ActiveRecord has been modified to include WCF declarations such as [datamember], [ServiceContract], [OperationContract] and the _isLoaded has been exposed using a property called Loaded.
The WCF is then being consumed by an asp.net admin website that has been generated using T4.
The WCF will eventually be consumed by a silvelight app and a client application.The problem:
Saving and deleting works but updates have issues with dirty columns.
The dirty columns are remembering the wrong columns that need to be updated regadless if it is a foreign key or just a regular column like a string or number column.A column property looks like this:
string _Description;
[DataMember] public string Description
{get { return _Description; } set { if(_Description!=value){ if (_db == null) { _db = new DAL.Data.DALDB(); } if (_repo == null && _db != null) _repo = new SubSonicRepository<Product>(_db); if (tbl == null && _repo != null) tbl=_repo.GetTable(); _Description=value; var col=tbl.Columns.SingleOrDefault(x=>x.Name=="Description"); if(col!=null){ if (_dirtyColumns == null) _dirtyColumns = new List<IColumn>(); if(!_dirtyColumns.Any(x=>x.Name==col.Name) && _isLoaded){ _dirtyColumns.Add(col); } } OnChanged(); } }}
Comments
-
SimpleRepository 'Add<T>' method returns object typed as 'decimal' instead of 'int'
0 comments Created 2 months ago by appakzWhen using the SimpleRepository 'Add' method and passing in an instance of 'T' where the primary key field is an integer (i.e public int PostID {...} in a class named 'Post') the return value is sent back typed as a decimal instead of an int. This appears to be related to how the data reader that reads back the 'SELECT SCOPE_IDENTITY' deals with that type.
I've seen this behavior on two different machines both of which were running against a local installation of SQL Server 2005 Express Edition.
Comments
-
in source code have a "#if debug console.writeline ..... " you can made something to enable write in a text file...
this will help a lot!!!
Comments
-
I deployd my website to a live server at a shared hosting porcider.
And get this error.
On my dev server it works fine and also the live DB works.
Please help me beacause is have been searching for a solutions for a week now and im stuk
Code:protected void Page_Load(object sender, EventArgs e) { var Countries = tblCountry.All(); foreach (var country in Countries) { Response.Write(country.CountryName + "<br>"); } }Stack Trace:
[SecurityException: Request failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150 System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100 System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +284 System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +69 System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +150 System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +30 System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +40 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +123 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54
Comments
-
I am using SS 3.0.0.3 ActiveRecord (Current master build) with SQLite. This query:
new Update<BillDetail>(provider) .Set(bd => bd.DivisionDetails == divisionDetails) .Where(bd => bd.BillNumber == documentId && bd.IsInvoice == true);produces this SQL:
UPDATE `BillDetails` SET `DivisionDetails`=@up_DivisionDetails WHERE `BillNumber` = @0Rob informed me here: http://stackoverflow.com/questions/1368405/subsonic-3-updatet-problem that the problem was fixed but it still is not.
Comments
-
I am using SS 3.0.0.3 ActiveRecord (Current master build) with SQLite (I think this error might be reproducable in other databases also, although I didn't checked).
If I do something like this:
var customerRepo = Customer.GetRepo(); var customerList = customerRepo.GetAll().ToList();And then after making changes to the list, try to do this:
customerRepo.Update(customerList);It causes a SQLite error because if the customer is not changed (i.e. IsDirty flag is false) the sql is not empty but this:
UPDATE `Customers` WHERE `Id` = @0; UPDATE `Customers` WHERE `Id` = @1;If a check for IsDirty flag is added to method public int Update(IEnumerable items, IDataProvider provider) at line 279 of SubSonic.Core\Repository\SubSonicRepository.cs, the error is resolved.
The resultant public int Update(IEnumerable items, IDataProvider provider) method should be:
public int Update(IEnumerable<T> items, IDataProvider provider) { BatchQuery bQuery = new BatchQuery(provider); int result = 0; foreach(T item in items) { if (((IActiveRecord)item).IsDirty()) // adding this check fixes the problem... { var query = item.ToUpdateQuery(provider); bQuery.Queue(query); } } result = bQuery.Execute(); return result; }Comments
-
Comments
Apocatastasis
Fri Oct 23 10:42:46 -0700 2009
| link
I have a simple sp with one parameter of type int. When I try to fill my dataset with sps.executedataset I got the following error: Implicit conversion from data type sql_variant to int is not allowed. Use the CONVERT function to run this query
Línea 159: DbDataAdapter da = Factory.CreateDataAdapter();
Línea 160: da.SelectCommand = cmd;
Línea 161: da.Fill(ds);
Línea 162:
Línea 163: return ds;Thats seems Subsonic did not recognize the parameter type.
Apocatastasis
Fri Oct 23 10:51:03 -0700 2009
| link
My code is the following:
<DataObjectMethod(DataObjectMethodType.Select, True)> Public Function ObtenerApoyosSolicitados(ByVal idProyecto As Integer) As DataTable
Return SPs.ObtenerApoyosSolicitados(idProyecto).ExecuteDataSet().Tables(0) End Function
Apocatastasis
Fri Oct 23 11:30:47 -0700 2009
| link
OK, that's problem of the VB template, wich doesn't generate the parameter type.
-
Find and SingleOrDefault not working in Test Mode
0 comments Created 2 months ago by eibrahimI am having a problem while using the test repository and it makes it IMPOSSIBLE to test...
This line of code:
var dbFriend = Friend.SingleOrDefault(f => f.UserId == id && f.FriendId == friendId);Always returns the first element regardless of whether the expression is matched or not. This happens because of
var results=repo.Find(expression);in the ActiveRecord.cs file.
I tried to step through it but couldn't figure it out.
My table looks like this:
FriendUserId - unique, bigint, auto increment
FriendId - big int
UserId - big inI also noticed that the autoincrement features doesn't work in test mode. Is that correct behavior?
Comments
-
The update method in the test repository doesn't work. This method:
public int Update(T item) { var update = _items.SingleOrDefault(x => x.KeyValue() == item.KeyValue()); _items.Remove(item); _items.Add(update); return 0; }always sets the variable "update" to null because x.KeyValue() == item.KeyValue() always fail because it is trying to compare two references instead of their values. Even though I have an item with the primary key = 3 it will still return null because it is boxing 3 and comparing two objects instead of two integers (I think!!!)
If I change the method to
public int Update(T item) { var update = _items.SingleOrDefault(x => x.KeyValue().ToString() == item.KeyValue().ToString()); _items.Remove(item); _items.Add(update); return 0; }then the "update" variable is correctly retrieved but the PROBLEM now is
_items.Remove(item)does NOT remove the item from the collection... Not sure why???
I need some help. It is impossible to use the TestRepository in its current state...
Comments
-
Schema name missing in update query - ActiveRecord
1 comment Created 2 months ago by uskorcI just started to use subsonic and I have an issue. I only checked it briefly.
When updating an active record object the schema name is missing. If you update the same object or delete it, the schema name is present in the SqlQuery which gets passed to the ANSISqlGenerator.cs. If the table is not under the dbo schema I, of course, get an exception.
In generated Structs.cs file, the schema name is present for the table.
ActiveRecord templates/3.0.0.3/VS08/Win7
Comments
vleschenko
Sun Nov 15 06:48:20 -0800 2009
| link
i have fixed this problem locally. see my patch:
http://www.vitaliy.org/Download/fbf42366-e96a-4165-a6cc-d97a76bca507/Schema.patch -
ActiveRecord - Columns named the same as their table
0 comments Created 2 months ago by dliuzziThere seems to be a bug in the ActiveRecord template that causes build problems when there are columns with the same name as the table they are contained in. The template properly suffixes these columns with "X", but then does not use this suffix in the DescriptorValue() and ToString() functions.
To repro:
- Create any table with a field equal to the table name, for ex:
CREATE TABLE Country(CountryID int, Country nvarchar(50))
- Run ActiveRecord.tt
- Build
UPDATE: Please nevermind this. I found the latest version of the templates at http://github.com/subsonic/SubSonic-3.0-Templates My appologies; I'm very new to Git.
Comments
- Create any table with a field equal to the table name, for ex:
-
SQL Data type of tinyint set as "bool" not "byte"
0 comments Created 2 months ago by internaytLine 260 in SQLServer.ttinclude case for tiny int falls through to bit,
needs to be:
case "tinyint": sysType= "byte"; break;Comments
-
Linq query dose not suport custom class select
4 comments Created about 1 month ago by jrt324for example:
my Entity Class :
public class Org: IActiveRecord
{public string fieldA {get;set;} public string fieldB {get;set;}}
and in my linq query:
var linqNodes = from o in DB.Orgs select new TreeNode{ id=o.fieldA,text=o.fieldB};
var nodes = linqNodes.ToList();the TreeNode class is my custom class for tree node.
the nodes return record's field value is null.
I'm sure all records have the data in database.
Comments
funky81clone
Mon Nov 02 09:18:10 -0800 2009
| link
Does your properties name have diffrent name with your column name ?
Yes,properties of the TreeNode have diffrent name with column name
funky81clone
Mon Nov 02 17:46:33 -0800 2009
| link
Do you mind to check my branch - http://github.com/funky81clone/SubSonic-3.0/tree/CompleteFixedColumnNames . I have submit bug fixed for this. Dont forget to apply t4 template in http://github.com/funky81clone/SubSonic-3.0-Templates/tree/FixedColumnNames
Tell me if you can't compile or dont works....
-
Bug: It will always use Inner Join if you use the LeftInnerJoin<T>("from", "to") method.
0 comments Created about 1 month ago by terrysoIn SqlQuery.cs line 610:
private void CreateJoin(string fromColumnName, string toColumnName, Join.JoinType type)
{ //see if we can find the table var toTable = _provider.FindOrCreateTable(typeof(T)); //the assumption here is that the FromTable[0] is the table to join from if(FromTables.Count == 0) throw new InvalidOperationException("Can't join if there's no table to join to - make sure to use From() before InnerJoin"); if(toTable == null) throw new InvalidOperationException("Can't find the table for this type. Try using the Column instead"); var fromColumn = FromTables[0].GetColumn(fromColumnName); if(fromColumn == null) throw new InvalidOperationException("Don't know which column to join to - can't find column " + fromColumnName + " in table " + FromTables[0].Name); var toColumn = toTable.GetColumn(toColumnName); if(toColumn == null) throw new InvalidOperationException("Don't know which column to join to - can't find column " + toColumnName + " in table " + toTable.Name); CreateJoin(fromColumn, toColumn, Join.JoinType.Inner); }It always use Join.JoinType.Inner...
Comments
-
I think the "LeftInnerJoin" method should be removed...
0 comments Created about 1 month ago by terrysoAs i know, there is no "left inner join" keyword in the ms sql server, so i think we should remove the "LeftInnerJoin" method or replace it with a new method "LeftJoin".
Comments
-
I am trying to bind the results of a Linq query to a gridview.
Here is the query:
public IQueryable<PendingPaymentsTypedList> GetPendingPayments(DateTime dueDate) { var pp = from la in new Query<LoanApplication>() join c in new Query<ContactInfo>() on la.UserId equals c.UserId join e in new Query<EmailLog>() on la.LoanAppId equals e.LoanApplicationId into g from e in g.DefaultIfEmpty() select new PendingPaymentsTypedList() { LoanId = la.LoanAppId, Customer = c.FirstName + " " + c.LastName, LoanAmount = (decimal)la.LoanAmount, Interest = (decimal)la.InterestAmount, TotalDue = (decimal)(la.LoanAmount + la.InterestAmount), EmailSent = (e != null) }; return pp; }Here is the result when I try to bind to the gridview:
Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error: Details :
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Exception: The expression of type 'System.Linq.IQueryable1[<>f__AnonymousType12[<>f__AnonymousType02[ResponsibleLoan.Domain.Entities.LoanApplication,ResponsibleLoan.Domain.Entities.ContactInfo],System.Collections.Generic.IEnumerable1[ResponsibleLoan.Domain.Entities.EmailLog]]]' is not a sequence atComments
-
public List GetEmployeesByGroup(string group)
{ var value = group; return (from sge in Context.SecurityGroupEmployees join sg in Context.SecurityGroups on sge.SecurityGroupId equals sg.SecurityGroupId join lu in Context.Lookups on sg.SecurityGroupTypeId equals lu.LookupId where lu.Value == value select sge.Employee).ToList(); }for some reason TestMode Property makes it into protected override Expression VisitMemberAccess(MemberExpression m) in TSqlFormatter.
at this point it has writtent the following SQL
SELECT [t0].[Test], [t0].[EmployeeId] AS EmployeeId1, [t0].[EmployeeTypeId], [t0].[IsActive], [t0].[IsLockedOut], [t0].[Password], [t0].[PersonId], [t0].[UserName]
FROM [dbo].[SecurityGroupEmployee] AS t1
INNER JOIN [dbo].[SecurityGroup] AS t2
ON ([t1].[SecurityGroupId] = [t2].[SecurityGroupId]) INNER JOIN [dbo].[Lookup] AS t3
ON ([t2].[SecurityGroupTypeId] = [t3].[LookupId]) LEFT OUTER JOIN (
SELECT [t4].[EmployeeId], [t4].[EmployeeTypeId], [t4].[IsActive], [t4].[IsLockedOut], [t4].[Password], [t4].[PersonId], 1 AS Test, [t4].[UserName] FROM [dbo].[Employee] AS t4 ) AS t0 ON (([t0].[EmployeeId] = [t1].[EmployeeId]) AND (the real issue is that the column TestMode does not exist and it is defined as MemberTypes.Field. so the unsupported exception is thrown. I am really not sure what is happening because LinqToSql does not have this much difficulty.
Comments
I followed this through to the end and helped it along to find out what it was wanting to do.
SELECT [t0].[Test], [t0].[EmployeeId] AS EmployeeId1, [t0].[EmployeeTypeId], [t0].[IsActive], [t0].[IsLockedOut], [t0].[Password], [t0].[PersonId], [t0].[UserName]
FROM [dbo].[SecurityGroupEmployee] AS t1
INNER JOIN [dbo].[SecurityGroup] AS t2
ON ([t1].[SecurityGroupId] = [t2].[SecurityGroupId]) INNER JOIN [dbo].[Lookup] AS t3
ON ([t2].[SecurityGroupTypeId] = [t3].[LookupId]) LEFT OUTER JOIN (
SELECT [t4].[EmployeeId], [t4].[EmployeeTypeId], [t4].[IsActive], [t4].[IsLockedOut], [t4].[Password], [t4].[PersonId], 1 AS Test, [t4].[UserName] FROM [dbo].[Employee] AS t4 ) AS t0 ON (([t0].[EmployeeId] = [t1].[EmployeeId]) AND (TestMode = TestMode))is what it wanted to format. the problem is that TestMode is not a column in any one of the tables and in fact this will create this error "Invalid column name 'TestMode'." once the sql is executed. What I need help with is tracking down and finding out why a Field is being brought into the SqlTranslator and stop it. Rob, if you have any pointers on where to look and why, I would appreciate it.
This issue was found to have it's root in the method GetMappedMembers(Type rowType) in the QueryMapping.cs file. the issue was that it was merging Fields with properties and was trying to join two tables on the Field 'TestMode' This was causing invalid SQL to be generated.
-
Hello guys,
I tried setting up the timeout without success. E.g.
SubSonic.Query.QueryCommand q = new SubSonic.Query.QueryCommand(sql, db.Provider); q.CommandTimeout = 120; q.Provider.ExecuteQuery(q);But the command always timeouts after 60 seconds regardless of the value above.
So, shouldn't the method ToDbCommand in QueryCommand.cs be like this?public DbCommand ToDbCommand(DbTransaction trannie) { var connection = Provider.Factory.CreateConnection(); connection.ConnectionString = Provider.ConnectionString; var cmd = connection.CreateCommand(); cmd.CommandText = CommandSql; cmd.CommandType = CommandType.Text; cmd.CommandTimeout = this.commandTimeout; // is this missing? if(trannie != null) cmd.Transaction = trannie; foreach(var param in parameters) { DbParameter p = cmd.CreateParameter(); p.ParameterName = param.ParameterName; p.Value = param.ParameterValue ?? DBNull.Value; p.DbType = param.DataType; cmd.Parameters.Add(p); } return cmd; }Comments
-
The unary operator 'ConvertChecked' is not supported
0 comments Created about 1 month ago by ApocatastasisIn protected override Expression VisitUnary(UnaryExpression u) of TSqlFormatter.cs. The excepcion only raises on a table with an great number of records.
Comments
-
This lines of code does not update the database.
No exception occured. It just dont update the data.
public ActionResult Edit(int id, Customer info)
{ try { info.ModifiedBy = 1; //UserID info.Update(); return RedirectToAction("Index"); } catch { return View(); } }Comments
I've run into this issue when trying to update an object that I've previously created - ie, you follow a sequence like this:
var p = new Person() { Name = "badjer" }; p.Save(); p.Name = "foosums"; p.Update(); // doesn't update the DB, neither does p.Save(); -
Newline Chars cause Oracle Provider Error
2 comments Created about 1 month ago by mabraham1The Oracle provider does not remove newline characters, such as '\r\n'. "ORA-00936: missing expression" is the OracleException error when executing a select such as:
Northwind db = new Northwind ("DevConn"); var orders = from o in db.ORDERS select o; foreach (var item in orders) Console.WriteLine(item.COMMODITY_CODE);I'm using an Oracle Provider T4 template that I developed, and can provide a copy.
Comments
I've been working a bit with Mark on this issue. I have further updated his templates and provided very rough ExpressionVisitor implementation for oracle using System.Data.Oracle. It is available in my branch git@github.com:stimms/SubSonic-3.0.git
Simon,
It appears that you cannot fork your own repository...
http://github.tenderapp.com/discussions/repos/208-missing-fork-link
"Is this your own repo? We currently do not support forking of repos that you have created. You can create a new repo and push a copy of your code up, though." -
Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)
0 comments Created about 1 month ago by rapr04Hi I just used ActiveRecord.tt for creating ORM. When I dragged and dropped in my project the ActiveRecord.cs created successfully. But when I tried to build the project i got following compilation error :
"Error 4 Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?) D:\projects\Testing\SubSnonicTest\SubSnonicTest\ActiveRecord\ActiveRecord.cs 11508 20 SubSnonicTest"When I went in the code I found its coming from following method of ActiveRecord.cs:
public override int GetHashCode() {
return this.int_UserID; }I tried to figure out but could not. Please let me know its solution asap.
Thx in Advance
P. RameshComments
-
I have a problem in this line and i'm using the 3.0.0.3 version of subsonic.
_repo.Add(this,provider)
My record is saved but i got the error, "Object cannot be cast from DBNull to other types."
I think the problem it's because i have a foreign key that is also an index key in my db table and so it doesn't get a new id...Can anyone help me with this?
Thanks.
Comments
-
IsNew set wrong when calling Find on test repository
0 comments Created about 1 month ago by badjerIf I use Find on the test repository, the objects that it returns don't have the _isNew property set to true. So, if you call Save() on the object, it creates a duplicate row in the test repository, rather than updating the existing one. This bug is in the git repo as of the time of this comment (I updated from the official release version to fix another problem with Find =) )
Comments
-
Issue with CLOB/BLOB/NLOB/NCLOB to Byte[] in Oracle-flavored SS3
0 comments Created 27 days ago by mabraham1The Oracle-flavored SS3 doesn't handle converting CLOB/BLOB/NLOB/NCLOB to byte array (Byte[]).
The ODP.NET has a method for converting CLOB’s to string, similar to below:
OracleParameter paramHavingClobInIt;
string str = (paramHavingClobInIt.Value as OracleClob).Value; //C# syntaxThe issue there is that the conversion is done in Subsonic.Core/Extensions/Database.cs and Objects.cs. Subsonic.Core is meant to be DB-agnostic, and we would have to make reference to the “Oracle.DataAccess” assembly to use the above.
Any novel ideas?
Comments
-
SimpleRepository does not run migrations when Delete or DeleteMany is invoked
0 comments Created 11 days ago by saintedlamaWhen calling Delete or DeleteMany in unit testing setup context before any other SimpleRepository method will lead to an error because Delete and DeleteMany do not run migrations.
Comments
-
gridview sorting - Incorrect syntax near the keyword 'DESC'
1 comment Created 11 days ago by pholroydI am trying to implement paging and sorting on a gridview using an objectsource with a select method that returns viewEnquiry.GetPaged(SortExpression, intPageIndex, maximumRows).
The paging is OK but when a gridview column is selected to sort in descending order the error "Incorrect syntax near the keyword 'DESC' occurs" (see full details below). The value passed in the SortExpression parameter is "DateCreated DESC"
Incorrect syntax near the keyword 'DESC'.
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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'DESC'.
Source Error:
Line 7627:
Line 7628: Public Shared Function GetPaged(sortBy As String, pageIndex As Integer, pageSize As Integer) As PagedList(Of viewEnquiry)
Line 7629: Return GetRepo().GetPaged(sortBy, pageIndex, pageSize)
Line 7630: End Function
Line 7631:
Source File: C:\Documents and Settings\pholroyd.NA-SYS.000\My Documents\Visual Studio 2008\Projects\CRM\CRMData\ActiveRecord.vb Line: 7629
Stack Trace:
[SqlException (0x80131904): Incorrect syntax near the keyword 'DESC'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33 System.Data.SqlClient.SqlDataReader.get_MetaData() +83 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10 SubSonic.DataProviders.DbDataProvider.ExecuteReader(QueryCommand qry) +377 SubSonic.DataProviders.DbDataProvider.ToList(QueryCommand qry) +81 SubSonic.Query.SqlQuery.ExecuteTypedList() +122 SubSonic.Repository.SubSonicRepository`1.GetPaged(String sortBy, Int32 pageIndex, Int32 pageSize) +518 CRM.CRM.Data.viewEnquiry.GetPaged(String sortBy, Int32 pageIndex, Int32 pageSize) in C:\Documents and Settings\pholroyd.NA-SYS.000\My Documents\Visual Studio 2008\Projects\CRM\CRMData\ActiveRecord.vb:7629 CRM.CRM.Data.ViewEnquiryDAL.GetEnquiries(Int32 maximumRows, Int32 startRowIndex, String SortExpression) in C:\Documents and Settings\pholroyd.NA-SYS.000\My Documents\Visual Studio 2008\Projects\CRM\DAL\CRMDAL.vb:41
[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +71 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +261 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29 System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +488 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +17 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
SortExpression = "DateCreated DESC".
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Comments
saintedlama
Fri Dec 18 12:02:27 -0800 2009
| link
Is this issue really related to subsonic or does this exception occur by setting the sort expression on a DataView?






I'm hoping for a patch for this - solving this is over my head at the moment.