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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unable to store for xml Xpath result in a variable

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :Sql Server
HI ALL, Unable to store the results of xml  reults into a varible , it  throws an error declare   @r varchar(1000) set   @r =( WITH   XMLNAMESPACES (     'http://schemas.microsoft.com/analysisservices/2003/engine/2/2' as ddl2_2   , 'http://schemas.microsoft.com/analysisservices/2003/engine/2' as ddl2   ,'http://www.w3.org/2001/XMLSchema-instance' as xsi   ,'http://www.w3.org/2001/XMLSchema' as xsd ) select   DatabaseID "Object/DatabaseID" , CubeID "Object/CubeID" , MeasureGroupID "Object/MeasureGroupID" , PartitionID "Object/PartitionID" , DimensionID "Object/DimensionID" , ProcessType "Type" , WriteBackTableCreation "WriteBackTableCreation" , Parallel "parallel"   from #ega WHERE   ProcessingGroupID = 3 FOR   XML PATH('Process'))

View Complete Post

More Related Resource Links

how to store query result in variable


hello experts..

i am wishing to store the query result in any variable, please have look at below code.


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then

Dim conn As New SqlConnection(GetConnectionString())
Dim str As String = System.Web.HttpContext.Current.Request.Url.AbsolutePath
Dim previous = "SELECT views FROM Articles WHERE ([url]=@str)"
previous = previous + 1
Dim sql As String = "INSERT INTO Articles (views) VALUES (@previous)"
Dim cmd As New SqlCommand(sql, conn)
Dim pram As SqlParameter() = New SqlParameter(1) {}
pram(0) = New SqlParameter("@previous", SqlDbType.VarChar, 50)

pram(0).Value = previous

For i As Integer = 0 To pram.Length - 1

cmd.CommandType = CommandType.Text

How to store and retrieve multiple values in a single session variable .


I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.

Pass the server variable to search core result web part


I'd like to custom the search core result web part to filter results based on the log on user name.

It can easily be done in Dataview web part.

However the search core web part doesn't accept "<parameterbining>" to pass in the server variable [logon_user]. I can't figure out how to use <xsl:param> to get this server variable either.


Any ideas? Thanks a lot!

If you get confused, listen to the music play...

XQuery: Unable to resolve sql:variable('@variable').

Solution to problem in SQL 2005: http://beyondrelational.com/forums/p/4289/7997.aspx USE tempdb GO -- If table exists, drop it IF OBJECT_ID('Tbl','U') IS NOT NULL BEGIN DROP TABLE tbl END GO -- Create the source table CREATE TABLE Tbl (col XML) INSERT INTO Tbl (col) SELECT ' <page height="782" width="620" id="page1" number="5"> <layout> <region id="r1" x="0" y="0" height="782" width="620"> <img src="../../Images/page11.swf" /> </region> </layout> </page>' -- Local variables DECLARE @page1 VARCHAR(20), @sQuery NVARCHAR(MAX), @insertXML NVARCHAR(MAX) SET @page1 = 'page1' SET @insertXML =' <hotspot id="C0D7AE7C5807FCA934C02E8FE1765031E4B4FC3B" x1="38.45" width="0" y1="53.6" height="0" FileName="" pageRF="" roleId="1" FilePath="" externalLinkURL="http://...._hsw_hswsnake.pdf" title="A visual ...Works." index=""> <role id="34" action=""/> </hotspot>' DECLARE @sql NVARCHAR(MAX) SET @sql = 'UPDATE Tbl SET col.modify('' insert ' + @insertXML + ' into (//page[@id=sql:variable("@page1"

WCF Service Unable to Access Personal Certificate Store Unless Service Account is Logged In

I created a WCF service that has a method which makes a call to a SOAP web service over the internet. In order to make a call to the SOAP web service, it requires that an X.509 certificate be sent with the HttpWebRequest. The X.509 certificates are loaded in the Personal and Trusted Certificate store of the account which the service is running under. When the service account is logged into the server, everything works just fine. However, when the service account is not physically logged onto the server, it has problems loading up the X.509 certificate and fails authentication when trying to make the HttpWebRequest. I am new to WCF services so I don't even know where to start looking. Can anyone please help? Thanks in advance.

IF EXISTS(then how to store fld value in variable)


Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

how to store the values in a object variable (package level scope) in a script component

I have declared a variable of object type with package level scope.  I want to assign values to this variable inside a script component.  My object should hold 5 columns in a row.  How to implement this ?

Unable to Create Object Variable for Linq Data Class


For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



Variable to Store temporary page data


I'm working on a web page that is going to be used to enter data into a database. The page is going to be dynamic in that the user has the ability to add a row to the table with the same fields, ie lname1, fname1, mi1 then lname2, fname2, mi2

I'm wanting to use a variable to keep track of how many lines there are so that when I generate the added line I am creating a new field with the ID of lname+# . Whats the best way to do this, a global variable, session variable? As side note, first time programming in .Net or C# so I apologize for my lack of knowledge.

Unable to set up a new Secure Store Service Application in a single-server installation


Problem: after initial SharePoint installation, I tried to add the Secure Store Service Application under "Manager Services Applications".  The process screen returns something like "The time job created.  But failed to start in one or more servers in the farm."  Further investigation found that in the SQL Server, the secure service account was not added under the Login user accounts.  The Secure_Store_Service_DB has been created, but not under the name of secure store service account.  In another word, the database was created but the action seems to be incomplete.

Background: this is a single server farm installation on Windows Server 2008 R2, SQL Server 2008 R2, with AD CS and AD DS, DNS roles enabled on the same box.  The configuration task was running with the farm admin account which is also a domain admin, and has dbcreator, securityadmin, and sysadmin roles in the SQL server.


store textbox(inside the gridview) information in single variable".


Hi Friends.
Im using gridview. It contain Name, Sex, Mobile and Message
That Message details have to display in textbox(Inside the GridView),
Now I want store textbox information in single variable".

need to store the value of Execute SQL(dynamic sql) into variable.


Hi guys, I need to store the value of my dynamic sql query into a variable

Basically i am passing a table name and then doing a count(*) to get the number of rows but having difficulty in storing the value of the Exec(@sql) into a variable.

Pls help


Select @sql = 'Select' + CAST(@TRCnt AS Varchar) + ' = count(*) From [' + @TTableName  + ']'



Unable to store value back to list from NewForm.aspx

   In the List when we click "New" menu it will redirect to "NewForm.aspx" to get the value from the user. It have default webpart, as per our column. Now i unghost the webpart using designer and to make some UI change, but now am unable to store the value back to the list. The "Newform.aspx" page got reload. why it happen?, what  i have to do?

how to Capture query result in a variable?


hi i have written a store proc to send a e-mail after my package is executed For the body of the mail i have another store proc called which give a result set as a table and that has to be displayed in the mail . the hilighted part of the store proc is where i have to do some thing for this to happen below is my store procs  

Any help is greatly appreciated !!??

***************This is the main Store proc****************


ALTER Procedure [dbo].[Send_Email_Summary_DART_File_Download]


@Status INT





/**** Declare the variables used by SP internally ****/



DECLARE @DMRrecipients NVARCHAR(500);


DECLARE @DMRimportance NVARCHAR(500);

-- DECLARE @FileSize INT ;





How to store the result of a query in a CSV file



I'd like to create a stored procedure that runs a query and stores the resulting data in a CSV file.

How may I achieve this ?


Unable to AddTerm in Term Store Management using sharepoint webservice TaxonomyClientService.asmx an



I was not able to add term in term store management using webservice http://server:port/_vti_bin/TaxonomyClientService.asmx

i am using the below code

TaxonomyClientService.Taxonomywebservice taxonomyClientService = new TaxonomyClientService.Taxonomywebservice();

        taxonomyClientService.Credentials = System.Net.CredentialCache.DefaultCredentials;


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