So far I was using something like this if I wanted to update table.
var myData = from t1 in db.Table1
where ...
select new { do some math here };
and then I would call
myData.Update( db.Table2, x => new Table2
{
update columns here
}
That…
How do I deal with identity when I'm supporting multiple db's with Bltoolkit. I know that BL supports InsertWithIdentity call with linq whne doing inserts, but I think it only works with Sql Server and in this instance I don't want to use it in this…
So far I was mostly writing my table-column definitions mapping so they look similar to the Linq2SQL style.
eg Linq2SQL
private Nullable _MyColumn;
[Column( Name = "MyColumn", Storage = "_MyColumn", DbType = "int", CanBeNull = true )]
public…
How to map output parameter in SQL to an out parameter in DataAccessor? I've tried to put Direction.Output attribute, but with no luck. Nonworking sample:
public abstract class DocumentAccessor : DataAccessor
{
…
Here is an example usage of list associations taken from BLToolkit http://bltoolkit.net/(S(ibvuiu3itvirtq550l4r0n55))/Doc.LinqAssociations.ashx
[TableName("Categories")]
public class Category
{
[PrimaryKey, Identity] public int …
Let's consider I have FruitAccessor with two methods: GetBananas and GetApples.
public abstract class FruitAccessor : DataAccessor
{
[SprocName("GetAllBananas")]
public abstract IEnumerable GetBananas([ParamName("@MaxCount")] int…
I'm working on a project that has a DB of about 30 tables and about 100 stored procedures (MSSQL).
All the DAL code is implemented using Data Access Application Block. I believe that this approach takes too much time even if I just need to add a…
I am creating a method for checking the product key. everything working fine in bltoolkit the code is
private void CheckKey()
{
try
{
using (DbManager db = new DbManager())
{
…
Here is an example usage of list associations taken from BLToolkit documentation:
from p in db.Product
select new
{
p.OrderDetails.Count,
p.ProductName
};
where
class Product
{
[PrimaryKey, Identity]
public int ProductID;
public string…
We are developing our ERP application in C# and SQL Server 2008. For accessing data, we are using "BLToolkit", but some developers are using ADO.net, LINQ etc.
My question is which is best for accessing data?
We are starting to do a conversion to BL Toolkit but are hitting some issues and not finding answers. One such issue is the inability to get the MapValue attribute on our DTO's properly to map.
Using T4 templates, we generate this (as an example):…
The following source code:
sectors1 = from sector in db.GetTable();
sectors2 = from sector in sector1
join team in db.GetTable() on sector.TeamId equals team.Id
…
Usually with BLToolKit I fetch data from DB in the following way:
using ( DbManager db = new MyDbManager() )
{
IList objects = db
.SetCommand(query)//sometimes with additional parameters
.ExecuteList()
…
Does BLToolkit provide a facility similar to NHibernate's HQL; that is, allowing one to use dynamic SQL? I found this link in the BLToolkit documentation (http://bltoolkit.net/Doc.DACustomSqlQuery1.ashx?HL=sqlqueryattribute) that shows how to…