subsonic

Subsonic 3/ASP.net mvc trying to save a null value in a datetime column

情到浓时终转凉″ 提交于 2019-12-24 18:58:13
问题 I have a table that holds system users with their last login date and time in it. The admin users of the system need to be able to add users, but when I add the new user record a validation error occurs unless I put a valid datetime in the last login date field. I've tried manually changing the field to dbnull, null, etc prior to the save but it says those values cannot be converted to datetime. The column does allow nulls in the db. Any suggestions? 回答1: If you set LastLogin to be DateTime?

Calling an SQL function from a Subsonic.Select

你说的曾经没有我的故事 提交于 2019-12-24 18:33:54
问题 I asked the following question on the subsonic forum, but only seemed to get one response, so I thought I'd post up here as well to see if anyone could shed some more light on the problem... I wish to create the following SQL statement through SubSonic using the Select tool (or Query tool) .. it uses a custom function called "SPLIT()": SELECT * FROM VwPropertyList WHERE VwPropertyList.idCreatedBy = 123 AND VwPropertyList.idCounty = 45 AND 29 IN (SELECT Item FROM SPLIT(DistrictGroupList, ','))

Create A WPF ObservableCollection From A SubSonic 2.2 Collection

梦想与她 提交于 2019-12-24 12:23:50
问题 If I have a DAL created by SubSonic 2.2, how do I convert the Collections created by it to WPF ObservableCollections in code (pref.VB.NET) to be consumed by WPF? 回答1: Sorry !VB: [Test] public void Exec_Testing() { ProductCollection products = DB.Select().From("Products") .Where("categoryID").IsEqualTo(5) .And("productid").IsGreaterThan(50) .ExecuteAsCollection<ProductCollection>(); Assert.IsTrue(products.Count == 77); ObservableCollection<Product> obsProducts = new ObservableCollection

Subsonic VB.NET problem

被刻印的时光 ゝ 提交于 2019-12-24 12:19:59
问题 When I'm using VB.NET to use subsonic, It seems to have problem marking records as Old and Clean. Whenever I query using ExecuteSingle or ExecuteTypedList, i need to manually MarkClean and MarkOld, else whenever I save it will save as a new record. Am I the only one facing this problem ? I'm using SubSonic 2.2 btw. 回答1: I checked the source code of SubSonic.. and I found that the VB class generator doesn't implements the IActiveRecord. I think most likely is because VB.Net doesn't seem to

VB.net can't find by string

天大地大妈咪最大 提交于 2019-12-24 11:51:06
问题 Using VB.net, the following snippet gives the error below. Dim _account = Account.Find(Function(x As Account) x.AccountName = txtFilterAccountName.Text) or similarly if I do .SingleOrDefault (Function(x As Account) x.AccountName = txtFilterAccountName.Text) will both give the error "The method 'CompareString' is not supported". If I make the same call searching for an integer (ID field) it works fine. .SingleOrDefault (Function(x As Account) x.Id = 12) So integer matching is fine but strings

Views with business logic vs code

无人久伴 提交于 2019-12-24 11:27:20
问题 For an application I need to send personalized invitation emails to end-users every hour. Those users email-addresses, and the rest of their information are in the database. All users that have a bit Planned.IsPlannable set to True and have a Planned.DateStart and a Planned.DateEnd between a certain period are available for receiving an email message. There are about 350 messages to sent every hour . All information that must be included in the message is from the Database. The application is

Nullable types break ToXML() in subsonic 2.2

两盒软妹~` 提交于 2019-12-24 08:26:09
问题 When I call .ToXML() I get the error: "There was an error reflecting type..." I have a nullable types. How can I solve it? 回答1: The Subsonic forums have this thread, with a possible solution: http://forums.subsonicproject.com/forums/t/334.aspx #region Overridden XML Serialization Logic public override object NewFromXML(string xml) { System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument(); xdoc.LoadXml(xml); object lObject = base.NewFromXML(xml); PropertyInfo[] propertyInfos = lObject

SubSonic isn't generating MySql foreign key tables

你说的曾经没有我的故事 提交于 2019-12-24 08:24:00
问题 I two tables within a MySql 5.1.34 database. When using SubSonic to generate the DAL, the foreign-key relationship doesn't get scripted, ie; I have no Parent.ChildCollection object. Looking inside the generated DAL Parent class shows the following; //no foreign key tables defined (0) I have tried SubSonic 2.1 and 2.2, and various MySql 5 versions. I must be doing something wrong procedurally - any help would be greatly appreciated. This has always just worked 'out-the-box' when using MS-SQL.

SubSonic 2.2 Not Fully Update For VB?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 06:44:26
问题 An answer to a recent question on extending SubSonic pointed to a googlecode directory listing the relevant ActiveRecord templates. I was very surprised to see that most of the CS_ ones are a lot newer than the VB_ equivalents. Does this mean that SS2.2 has not been fully updated for VB? 回答1: See this thread For the reasons why vb.net isn't fully "baked" for 2.2 回答2: I committed a patch to the templates and made sure it was included in the VB versions. There weren't many template changes for

Subsonic 3.0 Medium Trust Issue

僤鯓⒐⒋嵵緔 提交于 2019-12-24 05:02:30
问题 I'm having an issue with running Subsonic in medium trust and don't know if i'm querying wrong - if there is some part of subsonic 3.0.3 that doesn't like medium trust can someone tell me? Someone else posted somethin similar a while ago and there was no real reply on whether it did exist or not (the bug). Rob said it had been tested, while someone else said they still had to bug (SubSonic 3.0 - Medium Trust) i'm using a query that looks like this: List<Data.Blog> objBlogPosts = ((from blog