C# - Subsonic Delete With Fluent Query Tool?

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


Similar Messages:

C# - SubSonic .Paged() Query Returns Duplicate Records

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

How To Update / Delete The Table Records In ASPNETDB.MDF In Single Update / Delete Query

Nov 29, 2010

I want to know how to Update / delete the table records in ASPNETDB.MDF in single update / delete query ?

View 1 Replies

Web Forms :: Selection Tool For Hierarchical Dimension To Query SSAS Cube

Mar 24, 2011

We are trying to design a selection tool for hierarchical dimension (e.g. org-dept-subdept) in order to query SSAS cube. When user clicks a dropdownlist, a tree view will pop out for user to select single or multi tree nodes. Ideally it would be like the dropdown box used in Excel pivot table when it is connecting to a SSAS cube.

View 1 Replies

How To Select Delete Query From Database

May 20, 2010

f i have one item in my dripDown list and i want to select it like to delete from the db. but the function didnt work because,it didnt change is "selected item", or if my drop downlist starts with somethins that i want to delete but i need to change the index first but i dont want to delete other items.

View 8 Replies

Access :: 2007, Delete Query Does Not Work?

Jun 16, 2010

I'm using Access 2007 for a project and I'm trying to run the following parameterized query:

string sql = "DELETE * FROM participants WHERE participant_id = @participant_id"
OleDbCommand command = DataAccess.NewCommand(sql);
command.Parameters.Add("participant_id", 1);
command.ExecuteNonQuery();

The really weird thing is that it will work if I hard code the value:
string sql = "DELETE * FROM participants WHERE participant_id = 1"

View 5 Replies

Security :: DELETE Query On Logged In User

Mar 16, 2010

a user loged in and he wants to delete his user. how do i make a delete query that refers to his userID how do i get the user id of the current logedin user?

View 4 Replies

MVC :: How To Display Edit And Delete View In J Query Light Box

Mar 24, 2011

How to display edit and Delete View in J Query Light box in MVC 3.0 razor view engine?

View 5 Replies

C# - How To Use Subsonic 2.0

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

DataSource Controls :: Delete Query Where [First] + ' ' + [Last] = @FullName, Asks For Original_ID?

Jun 10, 2010

I have a table of solicitors with three fields: ID, First, Last.

I created a page with a dropdown that has all the solicitors by their full name (First + ' ' + Last, example "John Dow") and a delete button to delete them from the above mentioned table.

I added a delete query to the solicitors table adapter in the xsd that looks like this:

[Code]....

I named the query "DeleteByFullName"
Here is the vb code for the delete button click event:

[Code]....

The problem is that the xsd expects the Original_ID as an argument and not @FullName

View 2 Replies

Forms Data Controls :: Sequential Delete Statements In A TableAdapter Ad Hoc Query

Mar 24, 2010

VS 2008 ASP.NET 3.5 app connecting to an MS SQL 2005 backend. The app contains a strongly typed dataset with a number of TableAdapters. I'm trying to add a query to one of the TableAdapters that deletes from table A, then related entries from table B, then related entries in the master table - table C. The query looks like this:

[Code]....

When I try to run that query to test it out, an error dialog box pops up that says "Unable to parse query text" followed by a second error dialog box that says "Must declare scalar variable @ID". Will the TableAdapters not run sequential Delete statements like this or did I do something wrong?

**Side note: A cascading Delete foriegn key relationship would be ideal, and was configured on the development database, but the DBAs messed up when replicating the database on the production server and getting them to fix something like this can be a difficult process.

View 2 Replies

Forms Data Controls :: Enable Delete Column At Gridview When Having Specify Query?

Sep 15, 2010

have trouble to add delete column to gridview when using specific query.I have PK set up at the table, I need add specific query to display dataat gridview:

SELECT [PID], [GID], [TID], [SID], [NEWSID] FROM [TableOne] WHERE ([NAME] = ?)

After builder this query, I click advanced button. However, generate insert, update, and delete Statements is not enabled.

View 19 Replies

To Set Subsonic Command Timeout?

Jun 23, 2010

Is there a way to set the command timeout for everything generated by subsonic?

View 1 Replies

Data Controls :: GridView Delete Query Executed Successfully Without Errors But Row Not Deleted

May 7, 2015

In a grid view me bind the data .if i click the update it throw the error like this

Server Error in '/bramandam site' Application.

Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 81: TextBox tfn = (TextBox)dv.FindControl("tsn");
Line 82: Label lb = ((Label)dv.FindControl("Label4"));
Line 83: string qry = "update section set sectionid='" + tbf.Text;
Line 84: qry += "',sectionname='" + tfn.Text;
Line 85: qry += "' where pk='" + lb.Text;

Source File: d:jquery themesramandam siteSection.aspx.cs Line: 83

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
Section.GridView1_RowUpdating(Object sender, GridViewUpdateEventArgs e) in d:jquery themesramandam siteSection.aspx.cs:83
System.Web.UI.WebControls.GridView.OnRowUpdating(GridViewUpdateEventArgs e) +133
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +720

[Code] .....

Version Information: Microsoft .NET Framework Version:2.0.50727.4984; ASP.NET Version:2.0.50727.4971
if i click the update i need to throw the error edit and update the contentĀ 

my gridview isĀ 

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="sectionid" onrowdeleting="GridView1_RowDeleting" onrowcommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal">
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />

[Code] ....

View 1 Replies

Mvc - None Of The Generated Classes From Subsonic For Data Are Available

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

Concatenate Two Columns In Subsonic Datasource?

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

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

Subsonic 2.2 Paging Linked Table Collection

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

C# - SubSonic Active Record Generate Class?

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

Subsonic And Two DataText Columns In Dropdownlist Control?

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

ManyToManyMapping With Fluent Nhibernate?

Feb 16, 2011

I have a table USERS and GROUPS table.

I want to add another table UserGroups.

How can I map these tables.

View 1 Replies

C# - Errors When Creating Custom Querable Object With MVC And Subsonic Pagedlist

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

C# - Subsonic 3.0.0.4 ActiveRecord Template For MySQL Error On Inserting New Record?

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

When Generate Against This Db Get All Kinds Of Errors Because Subsonic Is Expecting That Field To Be A Varchar?

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

ADO.NET :: How To Use Fluent Nhibernate - Finding Tutorials

Nov 9, 2010

, I want to use fluent hibernate with asp.net but couldn't find any website or tutorial for that , they're all to configure it with asp.net mvc , anyone knows any?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved