.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

how to generate an Xml pass Simple query structure like

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :ASP.Net
 
1. My sql query is        SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a2, My Data is HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    EdlinkHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP   &nbs


View Complete Post


More Related Resource Links

Use DB query result to generate Jquery required lines of code

  

Hello

I 'm gonna query database for photo records. each record include "photo path" where imagesURL  stored in string format

 I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.

How could I  generate these lines

<script>
$(function() {
$('#slideshow').crossSlide({
sleep: 2,
fade: 1
}, [
{ src: 'picture1.jpg' },
{ src: 'picture2.jpg' },
......
.....
{ src: 'picture4.jpg' }
])
});
</script>

Pass XSL "Currently Selected" Value via Query String

  
Hi, I have a DVWP with an ID column, that's connected to other webparts on the page to filter their values accordingly.   I also have a "Print" button that opens a custom ASP page that's essentially a print-friendly single item data view.  How do I pass the "selected item" value to the URL when a user hits the print button? I've already set up the "ID" parameter and filters on the target page, just need to know how to get the value info from the list ID field inserted into the URL upon button click.  Thanks in advance

how to create a List order and unourder a simple Sql Query

  
A Simple Query Pass to connection String 1 My Query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a   2,My Data is HD    HEAD    SH    SUBHEAD    TRK    TRACK    TGT    TARGET    PDC    DT_RELEASE    STATUS    COHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR1    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP    EdlinkHR    HR  

Issue with one of simple query

  
Hi team, I have a issue in the one of my query select   * from Prod3 where pnumber in (select distinct Policy from prod3_excel) order by pnumber This query gives me 8361 records and there are 8419 records in Prod3 how can i get the remaining records in Prod3 that is 58? select * from Prod3 where pnumber not in (select distinct Policy from prod3_excel) order by pnumber why this is not working? Thanks, Eshwar

How to pass string values to parameterized sql query in Clause?

  
Hi,I'm using parameterized sql query to get data from database string query = "Select * from employee where employee_city in (@value)";strign city ="'NewDelhi','Bangalore','Mumbai'";I'm using following code to achive thisDataSet ds = new DataSet();SqlConnection con = new SqlConnection("Server=localhost;....");SqlCommand cmd = new SqlCommand();cmd.CommandText =query;SqlParameter param = cmd.Parameters.Add("@value",SqlDbType.VarChar);param.Value = city;SqlDataAdapter dap = new SqlDataAdapter();dap.SelectCommand = cmd;dap.Fill(ds);But this is not giving the result.If run the query in SQLServer query window as "Select * from employee where employee_city in ('NewDelhi','Bangalore','Mumbai')", records are there.But the same query will not return any records from ADO.Net.How to solve this?Thanks,Ashokan

Ms sql query for this type of table structure

  
Hi This is my Table structure Field1       Filed2        001          A001          B001          C 001          D002          A003          B 003          C I need MS SQL query I need to show Field1 which has B and Not in DI mean 003 will shown coz it has B still D not comes... and 001 ,002 will not shown Coz 001 has B and D and 002 will not shown coz still it doesnt have B..Need Query... 

SSRS Query Designer (in BIDS) does not generate ANSI SQL

  
Hello, I have a problem when using SQL Server 2005 BIDS (Business Intelligence Development Studio) when connected to an Oracle data source.  The Query Designer generates the old Oracle SQL syntax instead of ANSI SQL.  This is with the Oracle 10g client installed. So, I would really appreciate it if anybody knows how to get the Query Designer to generate the ANSI SQL.   Thanks, Stuart

need a simple query

  
Hi All, I have a table with multiple rows but I want to select identical rows where createdon (datetime) date is less than one minute different for instance 1 - 299  - 1/9/2010 - 13:30:00 1 - 299  - 1/9/2010 - 13:30:14 Thanks  

Help to write very simple query...

  

How I can write this query ?

I have value = 1000

I wont to get all value from table [MHGROUP].CUSTOM2

from column CPARENT_ALIAS

all values which beginning with num 1000.

SqlCommand

 

cmd2 = new SqlCommand("SELECT * FROM [MHGROUP].CUSTOM2 WHERE CPARENT_ALIAS ='" + value + "'", con2


simple query

  

I need maximum mark scored each students and min mark scored each students.

I have done this way...

select ID,max(mark),min(mark) from table1 group by ID

But i need more field as Class.... I dont want include class field in group by clause

help


Parallel plan for simple query ! Any solutions

  

I am getting a parallel plan for a simple query below. Any workarounds

	UPDATE tblProfile
	SET PlanName = NULL, PlanValue =NULL
	FROM tblProfile pfl
	INNER JOIN tblCustomerPlan ts 
		ON pfl.planID = ts.planID
	WHERE (ts.Name = 'VOID' OR ts.Name = 'IPDC')
	AND ProfileURN = @ProfileURN 


simple query

  

Hi Team,

I am always confused with one simple query

i have get the data which is not in a table B

select *from TableA where col1 in (select col1 from TableB)

how to get the data in tableA which is not in TableB

select *from TableA where col1 not in (select col1 from TableB) why this is not working?

Regards,

Eshwar


Clean and simple way to generate XPS document using WPF

  

Is there a simple way to generate XPS document using WPF ? Most of the code samples I see on the MSDN and internet websites are at least 2-3 years old and have some ugly code to generate the XPS document. Have things improved with .NET 3.5 SP1 or .NET 4.0 ?

I hope the Microsoft WPF experts can help the community by providing a good code sample that shows how to accomplish this task.

 


Simple query on a table just hangs ...

  
We have a table that contains parameters for our DW jobs. I can do a "SELECT *" from this table which works fine. However, when we right click and view the "Top n" rows, the interface just hangs with a message "Executing Query. Waiting for response from data source". We have run a DBCC CHECKTABLE command on that table and it ran fine. Any ideas what the issue may be? We have even restarted the SQL Server (2008) and to no effect. We use the "Top n" interface to easily update parameters to run our jobs. Appreciate any help / feedback.
Jagannathan Santhanam

Pass Query String

  

Hi,
I want to pass the 2 parameters to the action "Initialize" when my application launch.

public ActionResult Initialize(string companyID, string quoteID)
{
}


 

Where my RegisterRoutes method looks like

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "MyController", action = "Initialize", id = UrlParameter.Optional } // Parameter defaults
            );
        }


Can somebody tell me what changes require in my code?

 

Thanks


Simple query on a table just hangs ...

  
We have a table that contains parameters for our DW jobs. I can do a "SELECT *" from this table which works fine. However, when we right click and view the "Top n" rows, the interface just hangs with a message "Executing Query. Waiting for response from data source". We have run a DBCC CHECKTABLE command on that table and it ran fine. Any ideas what the issue may be? We have even restarted the SQL Server (2008) and to no effect. We use the "Top n" interface to easily update parameters to run our jobs. Appreciate any help / feedback.
Jagannathan Santhanam

Pass paramaters to Open Query (oracle)

  

I am trying to pass two paramaters into an oracle open query

 

The first is a comma split string value of item numbers

and the second would be date ranges, - 4 of them  1) most recent 6 months, 2) most recent 12 months 3) most recent 18 months 4) most recent 24 months.  As i understand it - the open query is treated as dynamic sql and this is more challenging -

This table has alot of info so I do not want to bring back everything

 

 


KDW
ALTER Proc [dbo].[USP_SALES_LAUNCH_X]


 @Year int


AS





	SELECT TOP 100	sal.EM_ITEM_NUM 
	, typ.PGM_TYP_DSCR
	,ref.SELL_DSCR
	,ref.NDC_NUM
	,ref.SPLR_ACCT_NAM

	from openquery(ops_oracle_iw,
		'select	
				 oss.INVC_DT
				,oss.EM_ITEM_NUM
				,oss.SLS_QTY 
				,oss.SLS_AMT 
				,oss.CNTRC_LEAD_TP_ID
		from dcp0.V_SALE_ITEM oss
	WHERE SEL_GNRC_IND IN ( ''Y'', ''N'')
	AND oss.SLS_PROC_WRK_DT BETWEEN TO_DATE(''01/01/2009'', ''MM/DD/YYYY'') AND TO_DATE(''12/31/2010'' , ''MM/DD/YYYY'')
	AND oss.EM_ITEM_NUM in (''2242428'', ''2243087'' , ''2243624 '' , '' 2242758'' , ''2244051'', '' 2242782'', ''2243525'')

') as sal


	left join BTSMART.cb1.V_CNTRC_LEAD_CB_ATTR cnt
		on sal.CNTRC_LEAD_TP_ID= cnt.CNTRC_LEAD_NUM
	 left join btsmart.cb1.T_PGM_TYP typ
		on typ.pgm_typ_cd = cnt.pgm_typ_cd
		LEFT JOIN
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend