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

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

How to pass the file path in EXEC of Stored Proc for getting IIS Logfile data

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Hello,                  I need to get IIS Logfile data from Stored Proc. How to do this. I am using Bulk Insert Method in my stored Proc When I execute the stored proc I am getting an error that  Incorrect syntax near 'C:\WINDOWS\system32\Logfiles\W3SVC1\ex100802.log'.     Below is the code.                 Create  PROCEDURE  spWebLog @path varchar(300) AS begin exec('BULK INSERT Weblog from''' + @path + ''')  end go Declare   @SQL Varchar(100 ) Set    @SQL= 'C:\WINDOWS\system32\Logfiles\W3SVC1\ex100802.log' exec   spWebLog @SQL    

View Complete Post

More Related Resource Links

how to pass XML file path as input string to a Stored Procedure


Hello All,

I need to pass the file path (or hardcode the XML file path ) of an XML file to a stored procedure. This SP will then read the values from the XML file and based on these values the Insertion / updation will be done thereafter.

I am not able to pass the XML file path to this stored procedure.  Right now I an doing as givn below :

DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc ='
  <add key="approvalMode" value="On" />
EXEC sp_xml_preparedocument @idoc OUTPUT,'c:\Inetpub\wwwroot\HealthandSafety\Aspx\ApprovalMode.xml'

FROM OPENXML (@idoc,'/configuration/appSettings/add',0)
      WITH ([key]  varchar(10),
            value varchar(20))
EXEC sp_xml_removedocument @idoc

Here any change in the xml file needs to be changed in the SP too. This will lead to double work as later on this SP will be made as an SQL job.

Is there a way I can pass or hardcode the XML file path in the SP rather than duplicating the XML file contents again

Please advice!!

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc


Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.


Thanks In Advance.

can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks

Reading data to a table from a stored proc

This has me brain locked.  1. I've got a stored procedure.  2. It does a select with a couple joins.  I want to take the results of that stored proc and read them into some a table -- temp table would be ideal.  here's my (really tough) constraints... these really complicate things: 1. the stored proc uses dynamic SQL. As a consequence, I don't know the columns it's going to return (it's kind of the whole point of using it).  2. Since the stored proc uses dynamic SQL, it needs to use sp_executesql internally.    What won't work(i don't think?): 1. I can't create a function that returns a table and does a "return select * from....", since you can't (I don't think?) call a stored a stored proc in the return statement of a function 2. I can't just do an "Insert into #xyz exec .." because I can't pre-define the temp table (I think this is needed?). 3. I don't have a linked server. and i'd rather not. All of this runs local in the same instance of SqlServer, and will have to handle loads of volume (each hit will return a few million rows).  So (I think?) OPENQUERY  is out.  4. OPENROWSET is a possibility, I suppose, but again, everything is running locally. I think that goes through OLEDB (?) and I'm not sure that's even an option.    THOUGHTS???  HELP?? is it even possible?? Pl

Create Excel file dynamically in SSIS package and fill it by resultset data returned by Stored proce


Hello Every One,

I have a scenario in which i am executing a Stored Procedure which returned a result set.

I want to create a Excel file [name_date_time] dynamically, and fill result set data into Excel file. And then finally sent Excel file to Specific user[Email ID].

Point is that the excel file should have unique name so i want to give name as name_date_time.

So every time when package run new file is created with unique name.


Can any one suggest me who to create Excel file and fill result set data into Excel file.

And then finally send that Excel file ?







Pass no of days in stored proc


Hi All, i need small help. in my stored procedure i have to pass no of days and EtlId. the no of days, right now its 90 but it may change in future. what do i have to do in my stored proc so i can pass any no of days? here's my stored proc.

create proc getlatestrecords

(@Days Int, @EtlId int)



Create table adhoc.dbo.fullimport


[SeqId] [int] NOT NULL DEFAULT ((0)),

How to pass perameters in exec command when we using XML in stored Procedure?


My SP is:

USE [PrintLableTest]




PROC [dbo].[sp_Insert_Table_PrintLabelTB1XML]

@pData varchar (1000)





DECLARE @CPART nvarchar(50)

DECLARE @ItemNo nvarchar(50)

DECLARE @TPART nvarchar(50)

DECLARE @Code nvarchar(50)

DECLARE @BarCode nvarchar(50)


Pass data to rdl file


Please see the below link




I want to send data to the rdl file which will call the web service and that web service will return dataset. As explained in the above article.

My question is how can I pass the data to rdl file (like parameters accept web service)?????

Thanks in advance.

How to retrieve data from SqlDataSource and pass to a variable?


Hi there,

I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:

    <asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" 
ConnectionString="<%$ ConnectionStrings:ForexDB %>"
ProviderName="<%$ ConnectionStrings:ForexDB.ProviderName %>"
SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure"
UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure"
<asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" />
<asp:ControlParameter Name="orderId" ControlID="frmOrderDetails" PropertyName="SelectedValue" />

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

convert SQL data to EDI 835 file


I was assigned to create a app to convert SQL data to EDI 835 file. (Electronic Data Interchange file for Health Care Claim Payment/Advice,  outbound process only).

Can someone help me where to start?

.NET Reflection: Dynamically Bind Your Data Layer to Stored Procedures and SQL Commands Using .NET M


One major inconvenience of using SQL stored procedures from code is having to match type information. You have to write long wrapper functions around the procedures just to expose the data types. In the .NET Framework, however, the reflection services of the System.Reflection namespace allow you to query rich metadata that describe data types. This article explains how to use reflection in .NET to end your stored procedure nightmares. The author creates four custom classes, including one that generates a SQLCommand object based on the metadata of a method. Using this library, you'll be on your way to automating the generation of stored procedures.

Atif Aziz

MSDN Magazine August 2002

Using Session to pass data between forms


In my app, I am displaying an Rss Feed, I have a button that takes the user to another form where they can select a them.  Upon selecting the theme, they are taken back to the original form. 

If the user has selected which theme they want to view then they click on the button to change theme, I need to pass the information about what rss feed they were viewing through session so that once they select the theme they want they are redirected back to the main page and the rss feed they were viewing should still be displayed.

Since I've already bound the data to the xmlDataSource and DataList I am trying the following:

Session.Add("CurrentRssFeed", XmlDataSource1.DataFile);

Session.Add("CurrentDataList", DataList1);

I'm not sure I am passing the data over correctly and I'm not sure how to specify it in the page_preinit.

Any ideas???

Trying to run a stored procedure from vb code with oracle data provider.



Here is my SP:

create or replace
 Open p_getuserssignon_recordset1 for
 SELECT Distinct(Userid), UserPassword, SecurityLevel, ActiveStatus
WHERE substr(UserId,1,2) <> vUid
Order By UserId;

I would like to run this SP from code and fill a gridview with the result. 

I am not sure how to go about this, as I have found several different examples, other than the one I  think I need.

I am using the oracle data provider and I have an input parameter (vUid, which will equal "zz").

First question. When filling a gridview with a result set from a stored procedure should the recordset OUT be defined as a REFCURSOR (like i did above)? 


Do you have example code as to how to execute the SP and fill a gridview?  I keep trying different variations of code i've found on the internet without any success other than getting more confused.

(I am using VS 2005, VB).

Thank you.



how to write a stored proc to prevent multiple users in uploading the reports at a time? plsss help



I wanted to know how to prevent more than one user from uploading the report at a time .I am new to .net ,plss help with the code that would be great.Details are below:

This is a Windos based app written in c# . When User A  clicks Upload option on  one server  from the menu  to upload the files  and at the same time when User B clicks Upload option on different server , User B should be alerted a message saying "User A's uploading is in progress,pls wait" . How to achieve this, plsss help with the code.. I am thinking this logic should be kept in a stored proc, How do I write that proc? plss help


Thanks in advance!

File Attachments from info-path forms to Sharepoint document library


Hi Experts,

How to upload file attachements from info-path forms to Sharepoint document library?

I need to add attachement from local-PC/Any User to Sharepoint Document Library.


Any help please?? Appreciated




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