DataSource Controls :: Xml.query In Sql And No Records?

Mar 15, 2010

I have table in database with xml field and data like below

[Code]....

there are no records found

View 1 Replies


Similar Messages:

DataSource Controls :: Trying To Query Records From A Db Using A Date

Apr 14, 2010

I'm trying to query records from a db using a date. But somehow the db doesn't return records.

The datetime collums have the data stored in this format in the db as datetime :

12-Apr-10 12:45:12 AM
The string a have available is in this format : 12-Apr-10

I need to somehow strip the time part of so i can use my date string in the query.

When i use the below method the database converts the datetime to a rounded date (12-Apr-10 12:00:00 AM).
But when i query for that date i still get no results.

I tried this:

SELECT ID, PerformedBy, SystemId, ServerId, CAST(FLOOR(CAST(CreateDateTime AS FLOAT)) AS DATETIME) AS Expr1, Reason, Action, Summary, EnteredBy,
Collumn1, Collumn2
FROM Changes
WHERE ('Expr1 = '12-Apr-10 12:00:00 AM')

But this way the Expr1 collumn is not recognized.

View 4 Replies

DataSource Controls :: Query Returns 0 Records?

Jun 5, 2010

How come my query returns 0 records?

SELECT WebSiteID, BanDate
FROM tblWebSite
WHERE (BanDate <> NULL)

The BanDate is a date column. There are date times through the table in this column. I just want the ones with a date and ignore the rest.

View 2 Replies

DataSource Controls :: Query With DataSet To Get Every Time Next 20 Records

Apr 29, 2010

I am using dataset which contains some records I want to query with dataset to get every time next 20 records. I don't want to do it throught loop is there any way that I can get next 20 records everytime.

View 5 Replies

DataSource Controls :: To Write The Query - Retrieve The Records?

Jan 16, 2010

i have a table for customer forecast with following fields.. customer, year, week, quantity. now i need to write the SP to retrive the records based on the from week,year and to week,year... like this... from 45th week of 2009 to 25th week of 2010. how can write the query...

View 4 Replies

DataSource Controls :: Sql Query To Show All Combination Of Records?

Jan 18, 2010

I've the following tables and I want the query to show all possible combination of records with SegmentID, RateCodeID & MealPlanID.

View 2 Replies

DataSource Controls :: Update Query To Edit Records And Save To Database?

Feb 22, 2010

I am doing update query to edit my records and save to my database...I am getting the query expression exception...syntax error (missing operator) in query expression 'WebLogin=krish'.

string strUserName = Request.QueryString["UserName"].ToString();
DateTime dateTimeNow = DateTime.Now;
string ConnString = ConfigurationManager.ConnectionStrings["Data"].ConnectionString;[code]....
I am getting the exception syntax error (missing operator) in query expression 'WebLogin=krish'.

View 3 Replies

DataSource Controls :: Linq Query To Select Parent Records Which Have Related Children

Jan 19, 2010

I have a basic CMS which I'm adding to a site to display some downloads organised into groups. I have two tables, one for the groups and one for the downloads. I'm using a repeated to display the groups with another repeater inside to display the children. This works perfectly.

However some of my download groups may not have any downloads related to them and I'd like to handle this by filter the groups so that only those with a relate download record(s) are shown.

I'm trying to do this with the query which populates the top repeater based on some ideas I read but I must be going wrong with the syntax.

Here is what I'm using to try and only select downloads groups which have downloads linked to them by the download group ID.

[Code]....

Can anyone offer any thoughts on how I should construct the query to perform this?

View 1 Replies

DataSource Controls :: Clause Criteria Eliminating Records In Outer Join Query?

Feb 15, 2010

I know I'm missing something here but I can't figure out what it is. I've got a query joining three tables....accounts, payments, and a table linking the two (there is a M:M relationship).I'm trying to pull a list of all accounts in the account table that have a payment that needs to be resequenced, and also the maximum payment priority if there are any payments that haven't been fully paid. If all payments HAVE been fully paid, I want to return a 0.

It's that last bit of logic that I can't get right. If I include that in the where clause, I get only the accounts that have a payment that hasn't been fully paid. If I take it out, I get all the accounts I get, but I get the highest payment priority whether or not the payment has been fully met.

Here is the query....how do I include the where clause criteria but still include all accounts?

select distinct
bat.acct_id,
isnull(max(isnull(crt.pymt_priority, 0)), 0)[code].....

View 6 Replies

Forms Data Controls :: How To Display Records After Going Through The Query Builder And Select "Test Query"

Nov 5, 2010

I have a SQL Data Source that displays records after going through the Query Builder and select "Test Query" yet when I save it, go back to the design mode and select View in Browser I get nothing but a blank screen.

View 3 Replies

DataSource Controls :: SqlDataSource And Parameters Query / Trying To Accomplish Is Building Dynamic Query

Aug 22, 2010

1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like

SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.

Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).

2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query

(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).

If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.

View 11 Replies

DataSource Controls :: Update Query Not Working When Using Query Builder To Configure Table Adapter

Jan 15, 2010

[code]...

This query works perfectly on the query analyser.

But when configuring the Table adapter ,I try executing the query and i get 0 rows affected.

What could I be getting wrong in this case.

NB:Existing GalleryID has been supplied.

View 1 Replies

DataSource Controls :: Can't Find Query's / By Right Clicking On Database Created A Query In Server Explorer?

May 17, 2010

By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.

View 10 Replies

Linq Query Returning Less Records Than Sql Query?

Mar 19, 2011

I am facing a big problem with simple linq query.. I am using EF 4.0..

I am trying to take all the records from a table using a linq query:

var result = context.tablename.select(x=>x);

This results in less rows than the normal sql query which is select * from tablename;

This table has more than 5 tables as child objects (foreign key relations: one to one and one to many etc)..

This result variable after executing that linq statement returns records with all child object values without doing a include statement.. I don't know is it a default behavior of EF 4.0 . I tried this statement in linqpad also..but there is no use... But interesting thing is if I do a join on the same table with another one table is working same is sql inner join and count is same..but I don't know why is it acting differently with that table only.. Is it doing inner joins with all child tables before returning the all records of that parent table?

View 2 Replies

DataSource Controls :: How To Convert Sql Query Into Linq Query

Mar 10, 2010

select Groupid,GroupName,onorusername from palgroup where groupid in (select distinct Groupid

View 5 Replies

DataSource Controls :: Accessing FK From A Query Via Entity Query

Jan 21, 2010

I've got a query such as

Dim MediaQuery =
From m
In dB.DOWNLOADS _Where m.ID = id _Select

which returns a record from the database. One of the fields in the record is a FK to another table. I need to read this value to be able to set a dropdown based on the ID but I can't work out how to access it. For a standard record I can just do the following txtTitle.Text = MediaQuery.FirstOrDefault().TITLE

However with the foreign key it doesn't work like that. I've tried drpGroup.SelectedIndex = MediaQuery.FirstOrDefault().DOWNLOAD_GROUPS.ID where DOWNLOAD_GROUPS is the FK field but it returns Object reference not set to an instance of an object. If you're simply wanting to read some values from a single db record in the entitiy framework and one is a foreign key how should I go about getting the value?

View 2 Replies

Forms Data Controls :: Count Records Found By SQL Query (C#)?

Apr 18, 2010

How do I cound the records found by an SQL query? I have searched google and have only found ways to do so in vb.net. I need to know how to accomplish this in C#.

Below is what I have made so far...

Default2.aspx file...

[Code]....

Default2.aspx.cs File...

[Code]....

View 5 Replies

Forms Data Controls :: Get The Itemindex Of A Listview When Sql Query Selects Random Records?

Nov 18, 2010

i use this query as my sql query :

SELECT TOP 5 * FROM MyTableName WHERE ID=@ID ORDER BY NEWID()

As you may know it gets 5 records by random. I use it with dataset and bind the listview to this dataset and in ItemDataBound i want to do some programming (like making some controls visible or invisible) i need itemindex.

but the question is : how can i get the itemindex of a listview when sql query selects records randomly?

View 8 Replies

DataSource Controls :: How To Retrieve Corresponding Records

Jul 3, 2010

I have table called "Logs". It has username, sitename, actiondate and lastupdate columns.

From this, I hve created tempLogs (Temp table) using condition where lastupdate >= somedate.

Once I get records in my temp table, I then want to retreive all the records again from "logs" table corresponding to same

username, sitename?

How would I do that.

BTW: Join will not work.

View 1 Replies

DataSource Controls :: Insert 10,000 Records In One Second?

Jun 27, 2010

Suppose we have a website with 10,000 viewers each second. And we want to insert the viewer's information to the SQL database. So we must insert 10,000 records to the SQL each second. And it may take long time to do.

My question is: How can we decrease this process.

View 3 Replies

DataSource Controls :: Find The Five Last Records?

Feb 19, 2010

How can I find the 5 last records ?

CREATE PROC [dbo].[SP_NEWS_SELECT]
(
@NB_NEWS int,
@ID_NEWS int,
@DT_PUBLICATION datetime
)
AS
SELECT TOP @NB_NEWS *
FROM [REP_CLI].[S_ETATS].[T_NEWS]
ORDER BY [DT_PUBLICATION] ASC

This does not work

View 4 Replies

DataSource Controls :: How To Select Top X Records From Each Group

Apr 7, 2010

i have two tables (Users, Roles) and each user belongs to one role. Can I make a sql query that returns 10 newest users from each role in one query?

View 5 Replies

DataSource Controls :: How To Remove Duplicate Records

Jan 29, 2010

I am using visualstudio C# with Sql server. I want to delete previous duplicate values if exists while inserting new values into the table.

View 2 Replies

DataSource Controls :: Calculate SQL Datediff For All Records?

Jun 17, 2010

I am trying to write some SQL to populate a gridview.

The sql should print out 3 columns:

Name, County, LastCollection (the amount of days since the last collection)

I have previously calculated the amount of days since last collection individually like this:

[Code]....

But am stuck on doing it for more than 1 record to populate the gridview which should show all the records and their last collection date.

View 9 Replies

DataSource Controls :: Loop Through The Records Of A Table?

Mar 19, 2010

im learning t-sql, infact i needed its while-loop to loop through records of a table, i found this code in some book:

[Code]....

i understand here that setting the rowcount variable to 1 will force the select statements to return only one record, do all above select statements return one record only?

if the underlined select statement returns one record everytime it is executed, isn't it supposed to return the same first record of the table everytime? is there a better way to loop through a table's records?

View 9 Replies







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