DataSource Controls :: Using Recursive SQL To Select A Subsite From The Sitemap Table
Feb 26, 2010
I am using a CustomSiteMapProvider to draw the SiteMap from a MS SQL database table. If I select all the rows in the SiteMap, everything works correctly. I now want to select a subsite from the SiteMap and display it and this subsite's subsites only. I am using recursive SQL to do this. The code below works correctly except the root record, record number 286, is not included in the result:
[Code]....
How do I include the root record, record ID 286, in the result?
View 5 Replies
Similar Messages:
Jun 29, 2010
how can i select a record from A table and insert into B table using linq?
View 2 Replies
Mar 16, 2010
I need to select the rows between 20 to 30 from a table without using where condition. How is it possible?
View 2 Replies
Mar 8, 2010
In anyway, is it possible to select data from a table, in such a way?
[code]...
View 4 Replies
Jun 7, 2010
I have to retreive all records from a table except 1 record. For example: I give example from default database in SQL ie "master" In "master" DB we have "spt_values" table. Now if I want to retreive all records from spt_values table except 1-1 record of type = A and type = B. To retreive all records its a simple query "Select * from spt_values where type in ('A','B')" -- this will returns 16 records. Now I want to retreive all record except 1-1 record left in each type, so it will return 14 records in result.
View 6 Replies
Jul 5, 2010
I need to select a field value from a database table. If the value read is '1' then I need a 'Y' to display as output in the select statement. I haven't figured out how to do this yet and queries I tried that did not work.
select IsIata from Table_1 CASE WHEN (IsIata = '1') THEN 'Y'
select IsIata CASE WHEN (IsIata = '1') THEN 'Y' from Table_1
View 4 Replies
Feb 23, 2010
I need to display the table name in the select statement. how?
exact question:
we have common columns in two tables. we are displaying the records by using
select column_name from table_name_1 union select column_name from table_name_2
But the requirement is, we need to display the source table_name along with the data. consider a,c are present in table_1 and b,d are present in table_2. we need the output in the following way
eg: column_name table_name a table_1 b table_2 c table_1 d table_2
View 2 Replies
Feb 9, 2010
Mmy data table has four columns. How can I get only selected columns name?
View 5 Replies
Aug 5, 2010
I have set up Linq to sql. I now need to fill a formview with a select that does a join across a few tables. Have not been able to find any example or tuts that go beyond the simple select. Any suggestions? Can this even be done?
View 1 Replies
May 23, 2010
I have 2 tables ( having one to many relation )
SELECT CAT.CAT_TYPE, Agencies.Name
FROM CAT INNER JOIN
Agencies ON CAT.CAT_ID = Agencies.CAT_ID
CAT_A Val1
CAT_A Val2
CAT_A Val3
I need the select statement to list only the last records of the Table Agencies , see the red color at the top , if this can be only acheived using SP
View 2 Replies
Apr 10, 2010
I'm using vwd 2008 express
I need to display a single field from an sqlserver table, do I need to use sqlDataSource ect. or is there a simpler way (like msaccess's LookUp) for single values.
View 1 Replies
Apr 6, 2010
I have two tables:
GalleryAlbums and GalleryPhotos.
I would like to Select all entries in the GalleryAlbums table, but Order them (DESC) by date values in a column (upload_date) on the GalleryPhotos table. Both tables have a column "album_id"
A little confused how I might write this statement.
View 15 Replies
Nov 21, 2010
I am using "Classified Ad" starter kit of Asp.net 2.0. In the Post Ad feature that using the ad "CategoryPath" control that recursively update link based on user select ad category. After user satisfied with the ad Category selection, the control generate a complete button link of the entire path.
If I am going to convert CategoryPath control from Asp.net to MVC / Ajax, how about I am going to do this?
View 1 Replies
Jan 18, 2010
I have three table like above, table C is mapping table which has foreign key of Table A and B.How can i select and insert data in Table C using Entity Frame Work?
View 2 Replies
Feb 17, 2010
I'm implementing a BLL layer and have a few questions. First, in my DAL, there is a contacts table, the select method is a sql query against a sql server 2000 database. The preview data returns everyting as expected. The query is
[Code]....
The BLL method is built like so
[Code]....
When using the BLL method to a gridview, the results of the subquery are not displayed. There are also other methods, each having a different where clause for ContactRole_ID and each is having the same issue of not displaying the subquery reult in the gridview. No error, but no data is displayed for the subquery either. Here is the templatefield of the gridview
[Code]....
Another item that is causing an error is in trying to update a record. Here is the DAL update method
[Code]....
And the BLL update method
[Code]....
The error says i have extra parameters, but have no clue where the extra parameters are being picked up. The error isObjectDataSource 'odsContacts' could not find a non-generic method 'UpdateContact' that has parameters: _ContactID, _Active, _ContactName, _Office, _VirtualOffice, _Pager, _Fax, _Home, _Cellular, _Email, _ContactRole_ID, Active, ContactRole_ID, ContactName, Office, Email, VirtualOffice, Pager, FAX, Home, Cellular.And the objectdatasource
[Code]....
View 4 Replies
Apr 25, 2010
how can i use cursor in this function ?
ALTER FUNCTION [dbo].[GetCatIDChilds]
(
@CatID [code].....
View 1 Replies
Jun 1, 2010
I have been working with this database for some time. Here is the situation...
I inherited a MS SQL database that has hundreds of tables with similar data. For instance:
FordTampa_customer is a table,
ChevyAtlanta_customer is a table, etc....
All of the columns are the same...just different tables with their own ID field. All I have done...Inside of another database id is created a table called 'Customer' and added an 'Dealer ID' column along with the rest of the other columns in the other tables...
So the combination of the 'Dealer ID' and the 'ID' field are unique.....I know...its not the best way to do things...but I cannot change the old data structure because I cannot have access to it. I am give back-ups on a weekly basis, so this is all I have to work with.
All right, on to the real point of my post...
Currently, I have an application that I use to select all of the data from the 'Ford_customers','Chevy_customers',etc... and inserts them into my new main 'Customer' table. I do this by selecting the table names, bind it to an arraylist, loop through the list and execute an insert statement.
I do this in VB.NET, but I would prefer to do it in a Stored procedure of some kind....I just am not sure how to accomplish it. I use this syntax to get my list of tables:
[Code]....
I am not sure how to take those names from the table and do another select based on that list of names.
View 1 Replies
Jan 19, 2010
I have a table that has three fields that hold the ID for vendors.They are vendor1, vendor2, and vendor3.These link to my vendor table on the ID.I want to select all three vendor names from the vendor table. when i do the following, it returns nothing
[Code]....
View 3 Replies
Jun 9, 2010
how can i select data into temp table from another database in sql server 2000
View 2 Replies
Dec 22, 2010
The drop down list is used to determine what search criteria will be used to find an invoice. I tried to set the Select method in the switch statement. I don't understand how to set the Select Method and the select parameters programmatically though . I tried a few different ways but can't make the compiler happy. My ODS is in scope in the code behind. I'm not able to access it's properties though. The BAL resides in a separate project that is a ClassLibrary. I also have a using statement for the ClassLibrary project in the code behind.
give me an example of how to do this?
Mark up:
[Code]....
[Code]....
[Code]....
[Code]....
View 1 Replies
May 9, 2010
protected void Button19_Click(object sender, EventArgs e)
{
SqlDataSource conn = new SqlDataSource();
conn.ConnectionString = ConfigurationManager.ConnectionStrings["Database2ConnectionString1"].ToString();
conn.SelectCommandType = SqlDataSourceCommandType.Text;
conn.SelectCommand = "SELECT FROM table1 (a, b)VALUES(@a,@b)";
conn.SelectParameters.Add("a",TextBox1.Text);
conn.SelectParameters.Add("b", TextBox2.Text);
int rowsAffected = 0;
try
{
rowsAffected = conn.Selectt();
}
catch (Exception)
{
Label1.Text = "Error";
}
finally {
conn = null;
}
if (rowsAffected != 0)
{
Label1.Text = "Data saved";
}
}
well it returns error no overloading method for select (P.S. same code work fine for insert)
View 5 Replies
Apr 14, 2010
I will declarate a attribute, but it gives me an error
This query works fine and returns 1 record from type int:
SELECT TOP 1 DataObjectVersionID
FROM tblDataObjectVersionPropertyValueText
WHERE PropValue like CAST('00010281' AS ntext)
ORDER BY DataObjectVersionID DESC
And when I will declarate a attribute/parameter it gives me an error:
DECLARE @dataObjectVersionId INT
SET @dataObjectVersionId = SELECT TOP 1 DataObjectVersionID
FROM tblDataObjectVersionPropertyValueText
WHERE PropValue like CAST('00010281' AS ntext)
ORDER BY DataObjectVersionID DESC
Error message:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'SELECT'.
View 4 Replies
Oct 19, 2010
I want to have a subste within my main site. I already configured IIS to add the folder and convert to an application in IIS. How in Visual Studio is the best way to deploy? What I have been doing is creating a separate web application and then doing a file system deploy to the sub-folder on the target server. This stinks a little because none of the paths work. I.e., /images/ on the subsite is really /mainsite/images/ and such. The biggest pain seems to be relative paths. Is there a way to add the subsite to the main web project and still treat as a site (permissions, debugging, etc.)?
View 3 Replies
Feb 23, 2010
I want to select all the customers from "customers" table from a specific country. I write the following query but it is not working. why?
select *
From customers
where country = @country;[code]....
View 1 Replies
Feb 8, 2011
I have created a server control which uses recursion to create a menu. It essentially outputs nested lists with anchors inside them.
Now, this works perfectly, however, since the control is calling itself to render the child menus, it is also rendering multiple identical WebResource.axd javascript file references in .
how to stop this from happening? I just want the one reference in my tag.
View 1 Replies