Combine SQL query result with XML query result
Hopefully someone can help me with this: I know how to setup and run a query on an SQL db and I can probably work out how to query an XML file, but how do I take the results of each and combine them into one collection (i'm presuming a dataset)? Once i've created the combined collection, i'd want to order it by some universal identifier present in both datasources e.g. product ID. It's worth pointing out that the XML file would not be in the same format/use the same field names (or number of fields) as the SQL query, so I guess I might need to bind my query resu...Can sql queries be nested in sql queries?
I am having problems with a template that uses the information from one sql
query to generate a query on another table. Let me be more specific. The
template in question receives a category ID value from a web page that
provides a menu of several categories to choose from. Each Category ID
represents several Items or products to choose from. When the template
receives the category ID, the first thing it does is run a query on my
item_category table (this table lists all of the items and associates them
with the appropriate category). This query returns several itemIDs that are
all...sql or my sql query
hi,in my database i have the two tables...1)programs 2)reservedin the programs...two fields 1)program id 2)maxseats................these details wil be entered by adminin the reserved table two fileds ..1)PRogramid 2)statusmy requirement is .. i need the available seats..meansif any body is intersted in any program...they wil select the program...then status becomes approved(1)..then i need the o/p as ...Query Result in SQL Analyzer
I have query like this.
case BOND when 'IP-1' then volume end as [IP-1],
case BOND when 'IP-9' then volume end as [IP-9],
case BOND when 'IP-12' then volume end as [IP-12],
case BOND when 'IP-41' then volume end as [IP-41],
case BOND when 'SBU' then volume end as SBU,
case BOND when 'SBL' then volume end as SBL,
case BOND when 'SBT' then volume end as SBT,
case BOND when 'SBR' then volume end as SBR
(select fromnode,tonode,volume,substring(fromnode,3,2) IP,
fromnode % 10 fromnode2, tonode % 10 tonode2,
when substring(fromnode,3,2)=...C# Ado.net Sql query parameter query
I'm trying to pass in a parameter value from an array in a loop that is used in a sql query and the results are populated to an xml file. The trouble is that I'm only getting the colums values in the outputted xml file. So I feel that the paramter is not being read.
So can anyone help as I'm really stuck on this one. The code is as follows :
public void DisplayUserInfo()
ArrayList UserIdArrayList = IdentifyUserID();
foreach(string ShowUserIDString in UserIdArrayList)
SqlConnection SqlConn = new SqlConnection(DBConnString)...can i do an sql query then use the result of that in another query...
for instance i need to find value of storyId from one table then make sure i do not pull that record from another table. is this possible
With SQL you can do something like this:
select * from TableB where StoryIdValue not in (select StoryIdValue from TableA)
This is just 1 of many possible solutions.
ChrisDont forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Yes this is possible. This is what is called a "Nested Query" in SQL.
...Display Result of SQL Query In a Table
Hello all, here is my problem. I have made an asp page that executes a SQL query on an MS Access database. This all works fine. I can even display the values returned using Response.Write. But what I want is for the result of my SQL query to be displayed in Table form, with Columns and Column Headings. Any assistance would be much appreciated.
You have 3 controls in the .net 2.0 to display data. Without code work. Just follow the wizards.
Those controls are: datagrid, detailsview e formview.
You can find in the net tutorial of how to use each of them
u can define a s...Question about SQL Server/Query Analyzer and timeouts
I was given a list of user comments from an old application and told to match it up with our current system. After all the easy methods I was still left with 95% of the records unmatched. The only way I had left was to try and match up the names. Given that people could have the same name I added a count to make sure it only found one record. This query has been running for over an hour now. How do I tell if it's actually running, or if it locked up?
Also here is the query I'm using, does anyone have any feedback on it? Is this poorly written, is my logic...SQL query question concerning distict results
hi,I have a query in which I am getting identical results, but I can't use the distict keyword because distinct requires you select the column that you are sorting by. If I do this my results are no longer distinct. Does anyone know how to resolve this issue? keepin' it real in the ATX.
Can you post the query and also some sample data containing identical rows so we can help you in a better way? ***********************Dinakar NethiLife is short. Enjoy it.***********************
ok, but it's not very easy to read.Basically if I remove xnr.relatebegin from the select my re...IF EXISTS SQL Question
I want to only go after Distinct email addressess that contain an @ symbol.
But then I want to return all fields. How do you correctly do that for Microsoft SQL Server?IF EXISTS (SELECT DISTINCT user_username FROM usr WHERE(user_username LIKE N'%@%'))
FROM usr Order By user_username
Try something like: IF EXISTS (SELECT DISTINCT user_username FROM usr WHERE(user_username LIKE N'%@%'))BEGINSELECT * FROM usr Order By user_usernameEND
IF EXISTS only checks for existence of a record matching the WHERE condition. The SELECT is never ...Display Result of SQL Query In a Table #2
Hello all, here is my problem. I have made an asp page that
executes a SQL query on an MS Access database. This all works fine. I
can even display the values returned using Response.Write. But what I
want is for the result of my SQL query to be displayed in Table form,
with Columns and Column Headings. Any assistance would be much
Can you post what you have code-wise so we can build upon that? If this post helped you, Mark As Answer.
On MSDN and ASP.NET a lot of samples and tutorials are available, for example: http://msdn2.microsoft.com/e...VB .NET Dataset SQL query results
Hi, I'm hoping someone can shed some light on how I can address variables returned to a dataset via a stored procedure.I've coded an AJAX Autocomplete control but due to the restriction of the control (only being able to return one value) I now need to use the returned value to search my DB. The stored procedure used for the Autocomplete returns the key information (and the description). I'm assuming the key info is stored within the dataset. So my question is, how do I read the key information into a variable for use elsewhere?Stored proc Select Statement;
SELECT SU...Display an image based on a SQL query result.
I Like to Display an image based on a SQL query result.
For example if my sql query returns a ‘5’ - I like to display OK.gif
If my sql query returns a ‘1’ - I like to display down.gif
Any help with the code would be much appreciated !
Thank You !
Hi Studio F1, first of all you should build a function that translate the sql query result into image url, something like:
public string BuildPath ( string code )
if ( code == "5" )
return "images/Ok.gif" ;
else if ( code == "1" )
return "images/down.gif" ;
return "images/unknown.g...SQL Query , SQL or Procedural
HIHi i need some help on what the SQL query would be, let's say i have a resultant table like this.
and i need to query by group and re-name every field as its TestID value for that selected group:
Example:if group "A" is selected:
if group "B" is selected:
and so on..
Here is a sample for you to play with PIVOT: