Changing The CreatedBy Convention In Subsonic (3x)?
Mar 7, 2011
I'm working against a database that wasn't designed by me and in all the tables there is a CreatedBy field that is an int. Now when I generate against this db i get all kinds of errors because subsonic is expecting that field to be a varchar.I don't particularly want to go and rename the field in all of these tables so I was hoping there was a way to "alter" or change the internal convention (without getting into the source) in subsonic.Has anyone been able/done this in subsonic 3.0.4??EDIT: I'm using the active record model in subsonic 3
View 1 Replies
Similar Messages:
Apr 18, 2010
but here's a case in point that I'd like to share and get input on. Below are two entities, coded like normal.
Csharp Code:
using System.Collections.Generic;using SharpArch.Core.DomainModel;namespace Venue.Core{public class Category : Entity{private virtual IList<Forum> forums = new List<Forum>();public virtual int Sequence { get; set; }public virtual string Title { get; protected set; }public virtual string Description { get; set; }public virtual bool Enabled { get; set; }public virtual bool Visible { get; set; }public virtual IEnumerable<Forum> Forums { get { return forums; } }public void AddForum(Forum entity) { forums.Add(entity); }public void RemoveForum(Forum entity) { forums.Remove(entity); }public Category(string title){Title = title;}}}
[code]...
View 10 Replies
Mar 1, 2011
I'm working on a project in which the client has required a lot of things to happen on a single page, and this has resulted in a rather large blob of HTML being rendered out to the client browser.
The main issue is with input tags (where runat="server" attribute is set), these tend to cause a drastic increase in markup size due to validation, updatepanel triggers, viewstate, and the control markup itself. I've done what I can to reduce the amount of triggers I'm using, I'm compressing the viewstate (to something like 8% of the original viewstate size), I've gotten rid of a lot of ASP.NET Validators and rolled my own, and and I've been using ClientIdMode to reduce the length of the ID attributes of many asp.net elements. All of these combined significantly reduces the amount of HTML being sent to the client, (for example going from 2 megabytes for a request down to 500-600 kb - these are HUGE pages, mind you).
[Code]....
View 2 Replies
Jan 12, 2011
I have ten textboxes (txtCO1, txtCO2... txtCO10).I need to set them all to the same text (blank). How can I use a for loop that just changes the number after txtCO, isntead of explicitly setting each text box's text property to ""?
View 6 Replies
Oct 24, 2014
Is there a recommended naming convention for files and folders in ASP.NET? So far, I've found this thread on the native ASP.NET forum. But it doesn't sound very useful. Some people say "meh, naming convention is not that important", others reply "no, naming conventions are important" but don't say what the recommended convention for ASP.NET actually is.I can use standard VB notation for variables and method names inside the files.
View 2 Replies
Jul 25, 2010
Here's mt entity:
Csharp Code:
using System;using System.Collections.Generic;using System.Linq;namespace Venue.Domain{ using Venue.Infrastructure.Domain; public class Forum : Entity { private IList<Forum> children = new List<Forum>(); private IList<Moderator> moderators = new
[code]....
Here's my class map:
Csharp Code:
using FluentNHibernate.Mapping;namespace Venue.Persistence.Mapping{ using Venue.Domain; public class ForumMap : ClassMap<Forum> { public ForumMap() { Id(x => x.Id); Map(x => x.Sequence); Map(x => x.Title);
[code]....
And here's my convention:
Csharp Code:
using FluentNHibernate.Conventions;using FluentNHibernate.Conventions.Instances;namespace Venue.Persistence.Mapping.Conventions{ public class ReferenceConvention : IReferenceConvention { public void Apply(IManyToOneInstance instance) { instance.Column(instance.Property.Name + "Id"); } }}
I get the following message:Could not find a setter for property Children ...
View 2 Replies
Mar 10, 2011
I am loading .aspx and .ascx files as StreamReader.
I want each file to register it's javascript and stylesheet dependencies in some declaration like a <%@ ClientDependency path="~/Scripts/jquery-1.4.1.min.js" %>.
Is there an existing convention for doing such a thing? I don't need an implementation, but I don't want to create a new syntax if there is already a way to do it.
Also, what are the guidelines for custom <%@ blocks in ASP.NET?
View 3 Replies
Mar 25, 2010
i try to use subsonic 3.0 but i can not do that. i decided to use subsonic.2.0. So i try to make it i can not :(
my Web Config :
[Code]....
also look this article: what is error? [URL]
View 1 Replies
Jun 23, 2010
Is there a way to set the command timeout for everything generated by subsonic?
View 1 Replies
Jul 28, 2010
I have an MVC project setup, and I've brought the subsonic Active Record templates into my project, and they generated successfully and I can use the subsonic classes to access my database. However, how do I create a strongly typed view using the subsonic generated classes? When I select "add View" and I check the checkbox to create a strongly-typed view, none of the generated classes from subsonic for my data are available.
View 2 Replies
Mar 20, 2010
Does anyone know how I can concatenate two columns in my subsonic datasource? I want to display a first and last name in this dropdownlist but I don't want to put them in the same SQL column.
View 2 Replies
Dec 26, 2010
I'm creating a small forum for my CMS and I'm using subsonic 2.2 as my DAL.
I'm loading my theads like this:
DAL.ForumThread item = DAL.ForumThread.FetchByID(id);
In my database my ForumPosts table looks like this:
ForumPostID | ThreadID | Description | UserID | CreatedOn| etc
So now when I have my DAL.ForumThread item I can load the connected post collection by using:
item.ForumPosts();
This all works great, but the problem is that I'm using serverside paging and want to add some additional select parameters too like showing only active records.
Is this even possible when using SubSonic 2.2 ? The workaround I have now is just creating a new SubSonic.Query and select the posts by threadid and there I can set pageindex and pagesize without problems but I think this can be done easier?
I also would like to know if it makes any difference performance wise by just using item.ForumPosts() or starting a new query, I think the forumposts are already in the ForumThreads collection and don't require a new database call right?
View 1 Replies
Jul 6, 2010
i wanna use to subsonic 3.0.4 but i dont know, how can i start to generate class and use to new Template of T4. example: create new solution for generating to table's class and add to my project. ??
View 2 Replies
Jan 4, 2011
In subsonic 2 we could do this:
public static void DeleteTable(SubSonic.TableSchema.Table table)
{
new Delete().From(table).Execute();
}
How can we do the same thing in v3? I can only seem to find documentation about using generics to target a specific table in the database...I want to be able to use it with a parameter as above.
View 2 Replies
Jul 8, 2010
Does anyone know how I can concatenate two columns in my subsonic datasource? I want to display a first and last name in this dropdownlist but I don't want to put them in the same SQL column.
View 2 Replies
Feb 8, 2011
Using a SubSonic (2.2) SqlQuery object, I am querying a view that contains distinct rows from another table. The results of the query, however, contain multiple rows for certain rows in the view. It appears to be because of a join on a temporary table in the query generated to achieve paging. How can I avoid this duplication of rows?
Bonus points: I have to use the view because SubSonic can't do .Paged() and .Distinct() at the same time. Why not?
View 1 Replies
Jun 8, 2010
I have the following code but when i try and create a new IQuerable i get an error that the interface cannot be implemented, if i take away the new i get a not implemented exception, have had to jump back and work on some old ASP classic sites for past month and for the life of me i can not wake my brain up into C# mode. The code is to create a list of priceItems, but instead of a categoryID (int) i am going to be showing the name as string.
public ActionResult ViewPriceItems(int? page)
{
var crm = 0;
page = GetPage(page);
// try and create items2
IQueryable<ViewPriceItemsModel> items2 = new IQueryable<ViewPriceItemsModel>();
// the data to be paged,but unmodified
var olditems = PriceItem.All().OrderBy(x => x.PriceItemID);
foreach (var item in olditems)
{
// set category as the name not the ID for easier reading
items2.Concat(new [] {new ViewPriceItemsModel {ID = item.PriceItemID,
Name = item.PriceItem_Name,
Category = PriceCategory.SingleOrDefault(
x => x.PriceCategoryID == item.PriceItem_PriceCategory_ID).PriceCategory_Name,
Display = item.PriceItems_DisplayMethod}});
}
crm = olditems.Count() / MaxResultsPerPage;
ViewData["numtpages"] = crm;
ViewData["curtpage"] = page + 1;
// return a paged result set
return View(new PagedList<ViewPriceItemsModel>(items2, page ?? 0, MaxResultsPerPage));
}
View 2 Replies
Nov 7, 2010
public void Add(IDataProvider provider){
var key=KeyValue();
if(key==null){
var newKey=_repo.Add(this,provider);
this.SetKeyValue(newKey);
}else{
_repo.Add(this,provider); //NullReferenceException was unhandled by user code
[Code]....
View 1 Replies
Feb 14, 2011
I'm working against a database that wasn't designed by me and in all the tables there is a CreatedBy field that is an int. Now when I generate against this db i get all kinds of errors because subsonic is expecting that field to be a varchar.
I don't particularly want to go and rename the field in all of these tables so I was hoping there was a way to "alter" or change the internal convention (without getting into the source) in subsonic.
Has anyone been able/done this in subsonic 3.0.4??
EDIT: I'm using the active record model in subsonic 3
View 6 Replies
Jan 10, 2011
The problem is when am assigning my session table value to newly created table and if now am changing any coloumn name then the session table value also changing.
But my question is am assigning Session value to newly created table so how should session value should be affected?
for refference in my application
sessionState
mode="InProc"
View 5 Replies
Jan 23, 2010
I have the following set-up.
BlogPosts
BlogToCategory
Category
One blog post can have many categorys and a category can be in many blog posts. (Hence the intermediate table.
How would I go about getting a list of all the blog-posts in one category.
I've tried this but cant seem to get it right (I get a IQueryable -> IEnumerable cast error)
public IEnumerable<BlogPost> FetchAllBlogs(int? CatId)
{
return from c in CategoryLink.All()
where c.CategoryID == CatId
select c.BlogPost;
}
[Code]....
View 3 Replies
Mar 21, 2011
what is the best way to call my controls?
LblUserName or LabelUserName or UserNameLabel
View 4 Replies
May 22, 2010
I have win.app page and want to change it to a web.app,how can I do that?is it possible?
for instance i want to transfer Data's in text boxes from Win.app to Web.app.
View 1 Replies
Oct 10, 2010
I'm trying to write an edit page to my db (with EF4), using the controller only (Homecontroller )On the page and on the controller everything is working fine only (!) that the action it self is not writing the changes to the dbThis is the code I'm using in the controller :
[Code].....
If I understand correct the "ApplyOriginalValues in MVC Ver 2 is the Parallel to "ApplyPropertyChanges" in MVC Ver 1(and this is what I have used ,
View 1 Replies
Aug 7, 2010
Using C# & ASP.Net
In my webpage am using gridview
Code.
In a GridView First Column is displaying as select option(name as "select") for each row, i want to change a name "Modify" instead of select.
How to change the name.
View 1 Replies