I've got the following code:
UserLoginData userLoginData = _securitySoap.Login(username, password);
_repository = new SimpleRepository(SimpleRepositoryOptions.RunMigrations);
_repository.Add<UserLoginData>(userLoginData);
var queryResult = _repository.Exists<UserLoginData>(x => x.UserName == userLoginData.UserName);
The last line thro...
How can I perform an idempotent insert row using subsonic with a SQL 2008 backend?
e.g.
I have a table "Colors" where name is the primary key.
Color c = new Color;
c.name = "red";
c.Save;
Color c2 = new Color;
c2.name = "red";
c2.Save; // throws duplicate key error;
I know I can just trap the error but I would prefer to do somethi...
Is it possible to use ASP.NET Dynamic Data with SubSonic 3 in-place of Linq to SQL classes or the Entity Framework? MetaModel.RegisterContext() throws an exception if you use the context class that SubSonic generates. I thought I remembered coming across a SubSonic/Dynamic Data example back before SubSonic 3 was released but I can't find...
VS 2010 rc; SQL Server 2008 eXpress; .net 3.5; database - northwind;
all options in tt template are set by default. It simply doesn't generates some tables in that bunch of code :
region ' Schemas '
if(DataProvider.Schema.Tables.Count == 0)
{
DataProvider.Schema.Tables.Add(new ProductsTable(DataProvider));
...
I need to filter the data retrieved from database adding clauses to the where in the SQL.
I'm trying to do this Using subsonic 3, but i'm getting an error... I'm lost!
SubSonic.Query.SqlQuery qry = new SubSonic.Query.SqlQuery();
qry.From<TFCore.Lugare>(); //I'm getting the error here "Object reference not set to an instance of an...
I'm trying to do a left join in subsonic 3 using linq but it doesn't seem to work, I get a big error.
var post = from p in Post.All()
join q in Quote.All() on p.ID equals q.PostID into pq
where p.ID == id.Value
from qt in pq.DefaultIfEmpty()
select n...
Hi, I've read many posts on Subsonic 3.0's LINQ left join issues, and how using the fluent interface is supposed to be the alternative.
However, no matter which type of join I try to use in the fluent interface (LeftOuterJoin, LeftJoin...), the query is -always-, no matter what, an Inner Join once it gets translated in SQL
I'm having i...
New to subsonic and having issues figuring it out. I am simply just trying to do a distinct search and any documentation I find is telling me to use the class/method
SubSonic.SqlQuery
Though I am finding out that since I am using the newest version, a lot of the documentation I am finding does not apply. For example, I am getting this ...
Trying to use SubSonic 3.0.0.4's Linq TEmplates. Got everything working. But in the Doc's I'm seeing how I can use aa IRepository to bulk insert, update, delete my db. Thing is - It wasn't included in the download. Is it somewhere else and I simply overlooked it?
I've got a ton of updates going from one "Save" call - so this would b...
I'm using SubSonic 3.0 (SimpleRepository) to handle database access in my ASP.NET MVC 1.0 application.
It would be nice to handle a transaction for every web request, committing if everything went smooth and rolling back in case of exception. Is this possible? If so, how?
I know this topic has been discussed many times, but I just coul...
Hello,
Updated below
I couldn't describe the question any better without going into detail.
I am having major issues with development/deployment of projects using SubSonic.
Up until now everything has been fine but this is seriously hampering my progress.
The project, while not important, is a CMS/Shopping Cart.
I am using
Visu...
i want to use subsonic 3.x with oracle database can any body help me
...
I have been having issues trying to return distinct records from a subsonic3 query using VB. My base query looks like so:
Dim q As New [Select]("Region")
q.From("StoreLocation")
q.Where("State").IsEqualTo(ddlState.SelectedValue)
q.OrderAsc("Region")
This returns duplicates. How can I add a distinct cl...
Here is the subsonic asp.net mvc application
http://subsonicproject.com/docs/MVC_Starter_Template
but its for MVC 1.0. How can i convert it to MVC 2.0?
...
db.Update<Luna.Record.TB_ITEM>().Set(
x => x.ITEM_DURABILITY == Convert.ToInt32(quantity))
.Where(x => x.ITEM_POSITION == Convert.ToInt32(position))
.Execute();
How will I add an AND clause this is how it looks like in plain SQL:
UPDATE TB_ITEM
SET ITEM_DURABITLITY=@quantity
WHERE ...
I tried 3 variants but doesn't seem to update (I am using Linq Templates and MSSQL)
Luna.Data.GameDBDB db = new Luna.Data.GameDBDB();
db.Update<Luna.Record.TB_ITEM>()
.Set(x => x.ITEM_DURABILITY == Convert.ToInt32(quantity))
.Where(x => x.ITEM_DBIDX == Convert.ToInt32(dbdidx))
.Execute();
Here is the o...
I have a table like so..
CREATE TABLE [dbo].[Locations_Hours](
[LocationID] [int] NOT NULL,
[sun_open] [nvarchar](10) NULL,
[sun_close] [nvarchar](10) NULL,
[mon_open] [nvarchar](10) NULL,
[mon_close] [nvarchar](10) NULL,
[tue_open] [nvarchar](10) NULL,
[tue_close] [nvarchar](10) NULL,
[wed_open] [nvarchar](10) NULL,
[...
Hi, Just getting started with SubSonic. I'm using the Repository pattern, so my domain objects are totally seperate, and SubSonic-generated classes are used only in my data access layer.
I'm wondering if a template exists that will give me a Save method (Insert/Update) that requires all table column values as parameters. My thinking is ...
Hi all,
I've been trying to use Subsonic Advanced Templates in a project for a while but most of the time I find myself writing a Stored Procedure as I can't find a proper way of doing it in code.
Subsonic created corresponding objects for my DB tables and for foreign keys it created IQueryable fields inside each object. These fields a...
Hi ,
While selecting records using Date-Field i am facing a problem ,
my SQL2005 View (ViewOrders) StarDate column Have
4/23/2010 12:00:00 AM
4/23/2010 12:00:00 AM
4/23/2010 12:00:00 AM
4/23/2010 12:00:00 AM
4/23/2010 1:07:00 PM
My Code using subsonic 3.0
AMDB ctx = new AMDB();
SqlQuery vwOrd = ctx.Select.From();
vwOrd = vwOrd.And(...