Access To Variables In Custom Log Provider?
Jun 29, 2006
Hello,
I found one post from the past asking this question, but didn't see an answer, so I am hoping someone can shed some more light on it:
I am writing a custom log provider in C#. Is it possible give this custom log provider access to the variables collection (via a variabledispenser object)? First glance at the log provider classes would tell me that this is not possible, though I would like confirmation. Also, if I am correct in thinking it is not possible, what was the reason for leaving this out?
Thanks!
View 3 Replies
ADVERTISEMENT
Feb 21, 2007
Hi,
Given that Task.Validate() exposes the package's VariableDispenser, but LogProviderBase.Validate() doesn't...
http://msdn2.microsoft.com/fr-fr/library/microsoft.sqlserver.dts.runtime.task.validate.aspx
http://msdn2.microsoft.com/fr-fr/library/microsoft.sqlserver.dts.runtime.logproviderbase.validate.aspx
...I guess that simply means that I can't access a package's variables within a custom log provider? Can anyone comment/confirm? Any other options/routes to achieving the same..?
We live in hope,
Tamim.
View 3 Replies
View Related
Oct 1, 2007
As far as I can make out it is not possible to access the variables collection from a custom log provider.
I'm interested to know what the rationale for this is. Why aren't the variables available for logging purposes?
Thanks
Jamie
[Microsoft follow-up]
View 6 Replies
View Related
Oct 1, 2007
I am interested in determining if package variables can be read from a custom log provider. I am able to pass the values into the custom log provider using an expression in a custom connection manager. My intention is to used the values of these variables upon package failure so I can capture the context of the failure. Unfortunately, if the value of the variable is changed at runtime, this update is not reflected in the custom log provider.
Is it possible to get direct access to the package variables from the custom log provider?
Thanks,
Marc
View 1 Replies
View Related
Jul 3, 2006
Hi Everyone,
I created a script task that uploads a file to a HTTPs site. The script task works well and now I want to turn this script task into a custom component...
I'm having problems on how to call the variables I have in the package, I already locked them for reading, but how am I suppose to access them and how can I put their values into strings so I can easily call them in the WebClient.UploadFile method?
Also, I am very new to custom tasks in SSIS.. and would appreciate if anyone of you can send me something (code, link, etc.) of a very simple custom task without any form or properties, that I can try to study.
Basically, what I want my custom task to do is,
1. Read the varialbes in the package.
2. use the variables values as input in my WebClient.UploadFile("varURLstring", "PUT", "varFilePath")
as you can see, my custom task is really simple... but I'm a noob here and I don't know where to go.
Thanks in advance,
Kervy
View 1 Replies
View Related
Feb 1, 2007
Hi,
I'm trying to simplify the deployment process of my project. I already had some troubles with the config files but lets say I solved that issue. I'm going to read a flat file and set the variables of my packages from this file. I was thinking to use a Script Task to do that but I will need to copy this task in every package (I have at least 30). So if I want to make some change this will be painful.
Then, I came up with the idea of creating a Custom Task called Config File Task. I'm working on this but I got stuck trying to get the variables from the package that is running my Config File Task.
This is the code I had in the Script Task:
Dim streamReader As New StreamReader(Dts.Variables("ConfigFilePath").Value.ToString)
Dim line As String
Dim lineArray As String()
Dim variableName As String
Dim variableValue As String
Dim readConfigurations As Boolean = False
While (streamReader.Peek() <> -1)
line = streamReader.ReadLine()
If line = "[CONFIGURATIONS]" Then
readConfigurations = True
ElseIf line = "[/CONFIGURATIONS]" Then
readConfigurations = False
Else
If readConfigurations And line <> "" Then
lineArray = line.Split("|".ToCharArray())
variableName = lineArray(0).Trim()
variableValue = lineArray(1).Trim()
If Dts.Variables.Contains(variableName) Then
Dts.Variables(variableName).Value = variableValue
End If
End If
End If
End While
Dts.TaskResult = Dts.Results.Success
All I want to do is set the variables that exists in each package from the config file. In my UI Class (ConfigFileTaskUI.cs) I can have access to the variables via the TaskHost which is passed as an argument of Initialize() method.
Any thoughts? I'd really appreciate some help!
P.S. I've been working on this for 2 days!
View 11 Replies
View Related
Mar 13, 2006
I am new to SSIS but I am learning fast. Any help is greatly appreciated.
I have written a custom log provider derived from LogProviderBase. I want to programmtically add the custom log provider to my package, but when I try this:
myPackage.LogProviders.Add("ACustomLogProvider");
I get the following exception:
"The log provider type "ACustomLogProvider" specified for log provider "{..GUID..}" is not recognized as a valid log provider type. This error occurs when an attempt is made to create a log provider for unknown log provider type. Verify the spelling in the log provider type name".
I have followed the instructions in BOL and as suggested in this forum, adding the DtsLogProvider attribute:
[DtsLogProvider(DisplayName="ACustomLogProvider", LogProviderType="ACustomLogProvider", Description="a description")]
Another way I tried is that I added a GUID attribute to my custom log provider class and then tried this:
Type aType = typeof(ACustomLogProvider);
Guid aGUID = (Guid)aType.GUID;
myPackage.LogProviders.Add("{"+ aGUID.ToString() +"}");
This also gives me the same exception "The log provider type ""{..the actual GUID for ACustomLogProvider..}" specified for log provider "{..a different GUID..}" is not recognized as a valid log provider type....
My questions are: Is it possible to add a custom log provider programmtically or must it be done through the SSIS Designer?
Must I deploy my custom log provider class for it to work programmatically? (I had perhaps wrongly assumed I would not have to deploy if I don't want it to show up in the SSIS Designer).
I would prefer to use a custom log provider instead of just logging within the SSIS event handlers because I can override the OnPostExecute, etc. but I cannot (can I?) override the specific event handlers like PackageStart, PackageEnd, etc because they are not exposed through DTSEvents.
Any help I would be very grateful for. Thanks.
View 8 Replies
View Related
Dec 1, 2007
Hi all,
I am currently on XP x64 and am trying to run a .vbs file, which needs access to an access file when the following error pops up:
"Provider is not specified and there is no designated default provider"
error code: 800a0ea9
source: ADODB.Connection
I have tried a bunch of stuff, but so far nothing has worked.
The following code is is question:
set AccessDB = CreateObject("ADODB.Connection")
AccessDB.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & sMSAccessDBPath)
any help would be appreciated......could I run this with cscript.exe (in the WoW64 folder) in through cmd.exe?
Thanks in advance for you help.
Jonathan
View 1 Replies
View Related
Jul 7, 2006
Hi,
I am using .NET Provider for SAP to import data from SAP BW to the SQL-Server 2005.
The OLE-DB source has an sql command like this
"exec Z_SQL_EXPORT @I_WEEK_FROM='200601', @I_WEEK_TO='200602'
I want to make this command more flexible by using a variable strWEEK_FROM and strWEEK_TO.
How can I do this?
Thank you for yout help.
Gerd
View 7 Replies
View Related
Nov 22, 2007
I'm using the Microsoft .NET Data Provider for SAP and it works fine.
But I want to do dynamic selects. I think it's not possible within the Dataflow-source to use variables in the sql command line.
So I created a scriptcomponent, but I don't konw how to declare the SAPParameter.
The MS Whitepaper doesn't give an answer.
I tried it with the sqlparameter but it doesn't work
Dim sqlParam As SqlParameter
sqlParam = New SqlParameter("@mandt", SqlDbType.Int)
sqlParam.Value = mandt
Does somebody can help me?
View 3 Replies
View Related
Feb 15, 2007
Hi All,
I have a tricky one for you...
1. I create a custom log provider on machine A.
2. I deploy the signed assembly to the../../DTS/90/LogProviders directory & the GAC on both machine A & machine B.
3. I create a new package on machine A & go to enable logging for this new custom provider: I find it in the drop-down list of providers, and I can add it successfully.
4. I create a new package on machine B & go to enable logging for this new custom provider: I find it in the drop-down list of providers, but I can't add it. I get the following error:
'...failed to create log provider...the log provider type "_" specified for log provider "_" is not recognized as a valid log provider type. This occurs when an attempt is made to create a log provider for an unknown log provider type. Verify the spelling in the log provider type name (package)."
Any ideas anyone??
Tamim.
View 5 Replies
View Related
Jan 18, 2008
I created a SSIS log provider derived from LogProviderBase, it's appear in my VS2005 and work fine, the only one problem is, there is not a dropdown list of connections in the SSIS Log Configuration column, how can I add it?
http://technet.microsoft.com/en-us/library/ms403361.aspx
thanks
View 6 Replies
View Related
Jan 20, 2006
Hi...
I am trying to do custom log provider that will post events to Notification Services...The idea is that if I could post the "SSIS events" to Notification Services, with a Custom Delivery Channel in NS, I would be able to do NS Subscriptions with real time monitoring of SSIS packages..
I have tried to use the sample custom log provider code in MSDN. The problem is after I added the custom log provider dll to the C:Program FilesMicrosoft SQL Server90DTSLogProviders folder and install to global assembly using gacutil...
The custom log provider is not showing up in the Provider Type under Configure SSIS logs...
View 7 Replies
View Related
Dec 14, 2006
can someone help me in this???? this function is throwing exception "sqlException unhandled in user code"."incorrect syntax near ?"
Public Overrides Sub UpdateUser(ByVal us As System.Web.Security.MembershipUser)
Dim conn As New SqlConnection(connStr)
Dim cmd As New SqlCommand("UPDATE users SET firstname = ?, lastname = ?, company= ?, address= ?, state= ? WHERE Username = ?", conn)
Dim u As User = CType(us, User)
cmd.Parameters.Add("@firstname", SqlDbType.VarChar, 50).Value = u.FirstName
cmd.Parameters.Add("@lastname", SqlDbType.VarChar, 50).Value = u.LastName
cmd.Parameters.Add("@company", SqlDbType.VarChar, 50).Value = u.Company
cmd.Parameters.Add("@address", SqlDbType.NVarChar, 200).Value = u.Address
cmd.Parameters.Add("@state", SqlDbType.VarChar, 50).Value = u.State
cmd.Parameters.Add("@Username", SqlDbType.NVarChar, 64).Value = u.UserName
Try
conn.Open()
cmd.ExecuteNonQuery()
Catch e As SqlException
Throw e
'Throw New Exception("Some Error occured during updation...")
Finally
conn.Close()
End Try
End Sub
View 11 Replies
View Related
Apr 25, 2007
Hello Everyone,
I am trying to use a custom role provider, the main purpose so that I don't have to use a database file. My web.config file is posted below. My problem is that I think I have followed all the steps to create a custom role provider using both articles on MSDN and some written by Scott Gu. After Modifying my web.config file I went to the asp.net configuration to test the connection. Users are created in the remote database but roles are being picked up and created in the App_Data folder. Can anyone give me a hint at what I am doing wrong? thanks in advance.
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="MyConnectionString" connectionString="Data Source=10.10.10.10;Database=MyDataBase;Persist Security Info=True;User ID=user;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<roleManager enabled="true"/>
<membership defaultProvider="CustomSQLRoleManager">
<providers>
<clear/>
<add name="CustomSQLRoleManager"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MyConnectionString"
applicationName="MyAppllicationName"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"/>
</providers>
</membership>
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
View 2 Replies
View Related
Jan 28, 2006
ASP.NET 2.0....
What is the proper way to rename the ASPNETDB.MDF to another name, such as TEST_ASPNETDB.MDF?
I know you can rename the db in the IDE, BUT, there are other places you need to change so that ASPNETDB.MDF isn't recreated. Do I have to make a custom SQLExpress provider or something to that effect?
Any examples? Thanks...
View 2 Replies
View Related
Apr 3, 2006
Hi,
I'm trying to use an OLE DB connection manager from inside a custom log provider, but can't get the code to work - I get an exception "A first chance exception of type 'System.InvalidCastException' occurred in SSEALogProvider.dll" on the last line of the code below.
I know the connection is OLE DB from looking at .CreationName.
I've tried both with & without ToConnectionManager90(), but appearently not in the right way, both cases gives the same exception.
Any tips on what I'm missing? All the examples I've seen are either creating (instead of using) connection managers, or are file based connection managers. Any and all help much appreciated!
Thanks/Kristian
if (this.ConfigString.Length == 0 || connections.Contains(ConfigString) == false ||
connections[ConfigString].CreationName != "OLEDB")
{
infoEvents.FireError(0, "SSEALogProvider", "The ConnectionManager " + ConfigString + " specified in the ConfigString property cannot be found in the collection, or is of the wrong type (expected CreationName='OLEDB'.)", "", 0);
return Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure;
}
else
[...]
public override void OpenLog()
{
if (!connections.Contains(this.ConfigString))
throw new Exception("The ConnectionManager " + this.ConfigString + " does not exist in the Connections collection.");
ConnectionManager connectionManager = connections[ConfigString];
IDTSConnectionManager90 connectionManager90 = DtsConvert.ToConnectionManager90(connectionManager);
object connObj = connectionManager90.AcquireConnection(null);
//ConnectionManagerOleDb connectionManagerOleDb = (ConnectionManagerOleDb)(connectionManager.InnerObject);
//object connObj = connectionManagerOleDb.AcquireConnection(null);
if (connObj == null)
{
events.FireError(0, "SSEALogProvider", "Could not connect to the log database with connection string " + ConfigString + ".", "", 0);
return;
}
// Exception on next line: "A first chance exception of type 'System.InvalidCastException' occurred in SSEALogProvider.dll"
OleDbConnection oledbConnection = (OleDbConnection)connObj;
View 3 Replies
View Related
Feb 14, 2007
Hi,
I have a package with a custom log provider, which runs in BIDS. However when I deploy the package onto SQL Server and run it on the deployed machine, if fails:
"failed to decrypt protected XML node DTS:Password...key not valid for use in specified state..."
Now this is definately to do with the custom log, as if I take it out & redeploy, I can run it on the deplyed server + also run it within a job. I have entered the custom log provider library (+ other required DLLs) in the GAC on the deployed machine, but I'm clearly missing something.
Any ideas pls??? I'm really stuck.
Many thanks in advance,
Tamim.
View 3 Replies
View Related
Jun 19, 2007
Hello,
I'd like to use Globals!ReportName and User!Language in custom code like this:
Function Localize(ByVal key As String) As String
Return ReportUtil.Localizer.Localize(Globals!ReportName, key, User!Language)
End Function
If I preview the report I get an error message saying that there is error on line 2 of custom code.
Is it possible to reach report variables in custom code?
Thanks!
Werner
View 8 Replies
View Related
Oct 19, 2011
i am using Microsoft Sql Server 2008 Report buider 3.0. and i generated report and that report how to use custom variables.
View 2 Replies
View Related
Oct 26, 2006
Hi
I am developing custom dataflow component ,I need to get the of variables of the current package in the component , how can i get it?
Thanks
Mani
View 6 Replies
View Related
Oct 13, 2006
Hello all,
I have been struggling trying to read and/or write package level variables from within my custom task. I'd like to be able to get and set values from within the Execute method of my custom task. I have searched this forum and the books online and can't seem to find the answer. I thought maybe I could use an expression on my task (mapping the package variable to a custom task public property) but that doesn't seem to be working for me. I also would have thought I could use the VariableDispenser object from within my task but the collection is empty. I have 3 package level variables configured and can't seem to find a way to access them (with intentions of getting/setting). Could someone point me to a good doc or provide an example that may accomplish this? Thanks!
(I'm using package level variables as a means of passing simple information between tasks that are not using a DB, if there is a better way I'm open to suggestions.)
Jay_G
View 3 Replies
View Related
Aug 13, 2005
Hello,I have developped an app that previously used locally stored Access database on my computer and now I want to switch to SQL server on the provider's machine. However I'm not sure exactly how to do this. I didn't find any help of this sort that would help me with this. Any ideas?Thanks a lot!Jan
View 2 Replies
View Related
Apr 12, 2006
In a previous post in Installation and Setup I was having problems just getting an ASP.NET 2.0 app to run on my web server. Now I'm having some different weird security issues.
I'm getting this message when just trying to open a database and put its contents into a gridview.
Access to the ADO.net Managed Provider 'SqlClientFactory' was denied in the data source with ID 'sqlEmployees' because of security settings.
I think this may have to do with our web server and our SQL server being separate machines. That always gives us issues. But I have impersonation=true in my web.config along with windows authentication and I have SQL Server configured with Windows and SQL authentication so things should be right, I'm thinking.
Any ideas??
View 3 Replies
View Related
Apr 17, 2007
Hi all,
I am currently working on a stored procedure in SQL 2000 where I use OPENROWSET function to read data from an Excel file into a temporary table.
It works fine when I logged in with username 'sa' and psswrd 'sa' but when I log in with another user name and password I get the following error:
"Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.40' has been denied.
You must access this provider through a linked server."
I am using VB 6.0 as front end. Is there anyway i can overcome this error?
Please help.
Dhiraj
View 7 Replies
View Related
Dec 27, 2007
I'm trying to export excel data to a SQL Server database as:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=D:DATA_SOURCEData2.xlsx', 'SELECT * FROM [Sheet1$');
I get errors:
Error Message: The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. Access denied.
Is there any reason for this error message? Thanks.
View 6 Replies
View Related
Jun 8, 2007
I am trying to find ways around the limitation of not being able to resize columns based on the text input. I am dynamically setting what values a column is getting from my query. I am wondering if I can access the table (and thus, the columns) from within the custom code.
For example:
Public Function Whynot() As Integer
Report.table1.TableColumn1.Width = ....
table1.TableColumn.Width = ....
Return 0
End Function
Neither of these seem to work, anyone else have any ideas?
Thanks
View 2 Replies
View Related
Apr 24, 2001
Hi,
I have created a view. However this view needs a specific variable that a user has inputted in Access. The variable I need to pass into the first view is a DocketID..Similar to a StoreID. I then must run the second view, which also depends on the same DocketID. Finally I must run a final query that takes the result from the second view, which takes the results of the first view.
Basically, I want to pass the variable from my VBA application to the SQL statement. I have been reading, and it seems that like in VB I must declare a local variable in a DECLARE statement. Is that right?
How would I pass the variable that can be held in the VBA application ex. DocketId = 220 and pass that 220 to my SQL statement which is running is SQL 7.0. Most of the statement will be running in SQL, not the VBA application.
View 4 Replies
View Related
Aug 23, 2007
Hey all...I'm pretty new to SSIS packages and things are coming along nicely. My problem is accessing variables in script tasks.
I've created two variables (package scope, strings, readonly = false) - aDetailFiles and strDetailFile
Within a Foreach Loop I loop through a folder. I've added a script task and within that I try the following:
Dts.Variables("User::aDetailFiles").Value = Dts.Variables("User:trDetailFile").Value.ToString() + "|" + Dts.Variables("User::aDetailFiles").Value.ToString()
Everytime this script executes I get the following errors:
at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
at ScriptTask_feac87c947ce4431a4fee0ba0e13631d.ScriptMain.Main() in dts://Scripts/ScriptTask_feac87c947ce4431a4fee0ba0e13631d/ScriptMain:line 25
I have searched this error message but the only thing I found was to set the ReadWrite variable property but I don't know where to set that.
Expresion property set as false also.
Any ideas? Thanks.
View 1 Replies
View Related
Apr 11, 2008
Hallo
i'm trying to connect a VFP DBC as a linked server on MSSQL2000sp3a, using following parameters:
Product name: VFP
Data source: \networkpath odbc
Provider: VFPOLEDB.1
No security context
I'm trying the same operation both from a W2000sp4 server (+ MDAC 2.8sp1 ?) and a WXPPsp2, against two identical copies of the DBC that resides on two different path (one on the final path and one on a test path).
From WXPPsp2 everything runs ok, from W2000 i'm always getting this error:
Error 7399: OLE/DB Provider 'VFPOLEDB' IUnknown::QueryINterface returned 0x80070005: Access Denied
(already reported in this thread, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1832362&SiteID=1 but it didn't helped me)
The error happens independently from the user the query runs under (basicly AD account, both domain admin and normal user).
MSSQL runs under a domain account which have full permissions (for test purpose) on the directories where DBC reside.
I did no further modifications on the WXP machine in order to have the linked server running, simply it ran smoothly from the beginning.
Clearly the difference rely on the different OS... but what else?
i ran component checker to determine the MDAC version but some components version numbers slightly differs from the expected ones (eg. resulting version is 2.0.1064 versus 2.0.1022 expected in MDAC 2.8) so i suppose to have MDAC2.8 sp1 on the server.
thanks in advance
View 1 Replies
View Related
Jan 2, 2008
Hi there!
For setting different languages on the column haeders i need to access a dataset from a custom code function call. I want to pass a parameter to the function that will allow me to find a specific item in the dataset - like a lookup function. I cannot find a way to get access to the entire dataset and to iterate through its components.
Is there any solution? Every hint will be helpful!
Thanks, Torsten
View 3 Replies
View Related