Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Sunday, March 25, 2012

activex on oracle forms

Anybody have a sample so as to use an activex control on Oracle forms?do you have specific ActiveX requirement
http://adfsoft.hypermart.net/sgrid/ gives a sample
check it out

Sunday, March 11, 2012

Activation

I was testing around with a sample service broker app using activation, and came across an interesting question. The little app sends a series of four messages to a queue, either on the same conversation or on seperate ones. Each message invokes one stored procedure in my activation procedure. All the procedure does is enter a record into a test table and then wait for an allotted amount of time. In my example, the first message called a proc that waited 20 sec, the 2nd one that waited 10 seconds, the third 5 seconds, and the 4th 1 second. I am using internal activation on the queue. It seemed that in both scenarios (sending on 4 separate conversations and on one conversation) the procedures executed "almost" sequentially. "Almost" meaning that the first procedure was done before the last one started executing. It makes sense to me that this would happen where I sent them on the same conversation, but not really when I sent them on 4 seperate ones. Is it because when I call a procedure from my activation procedure it locks the queue so that another message cannot be processed (I'm processing a message at a time)? How could I make it so that the 4th procedure (the one that only waits 1 second) returns before the 1st procedure (the one that waits 20 seconds)?MAX_QUEUE_READERS = ?|||

Sorry, my max_queue_readers where 5 in both situations.

Tim

|||

With one message per conversation then new instances of the stored procedure may be launched, so a message that arrived later may be processed sooner by a new instance activated procedure.

Also, even locally, the message order is only guaranteed within a conversation, so 5 messages sent on 5 conversation may arrive on the target queue in any order (unlikely to arive in different order, but one should not assume order between conversations)

|||You reference that new instances of a sproc may be launched for one message per convo, but what determines if it will or not? Will it only happen if some threshold is exceeded on the queue? The reason I was doing the little test was because I haven't seen any articles out there really detailing good ways to run large processing queries asynchronously for one application, so I was wanting to write one. My main curiosity was if there was any way to modify any of the settings for the procedure activation (which I don't think that there is).|||I just read your blog entry on Parallel Activation...neat stuff. Although, I doubt that it is something I would ever need to implement. I changed my procedures a bit so that they delay for a longer time period, and it appears that a new activation occurs ~ 5 seconds.

Thursday, March 8, 2012

AcquireConnection returns null

Hi,

we are facing some issue to get the underlying OledbConnection from the runtime ConnectionManager.

below is the code sample that we are using

IDtsConnectionService conService = (IDtsConnectionService)this.serviceProvider.GetService(typeof(IDtsConnectionService));

if (conService == null)

return;

ArrayList conCollection = conService.GetConnectionsOfType("OLEDB");

for (int count = 0; count < conCollection.Count; count++)

{

string conName = ((ConnectionManager)conCollection[count]).Name;

if (conName == conMgrname)

{

conMgr = DtsConvert.ToConnectionManager90((ConnectionManager)conCollection[count]);

ConnectionManager cm = DtsConvert.ToConnectionManager(conMgr);

Microsoft.SqlServer.Dts.Runtime.Wrapper.ConnectionManagerAdoNet cmado = cm.InnerObject as Microsoft.SqlServer.Dts.Runtime.Wrapper.ConnectionManagerAdoNet;

OleDbConnection conn= cmado.AcquireConnection(null) as OleDbConnection;

}

}

In the sample above the conn is null.

To this query Darren replied to use the connection of type ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 to create the connection.

Your call to GetConnectionsOfType("OLEDB"); will return native OLE-DB connections, not ADO.NET connections, using the OleDbConnection.

The connection type for the ADo>NET OLE-DB connection is -

ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

but if user creates an New OLEDB Connection from the Connection Manager panel of the BIDS and selects the same from the custom UI how to get the underlying OLEDBConnection? the CreationName in this case is "OLEDB" and not ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.

Replace the code inside the if branch with this:

ConnectionManager cm = conCollection[count] as ConnectionManager;

OleDbConnection conn= cm.AcquireConnection(null) as OleDbConnection;

HTH.

|||

Hi bob,

It still returns me null.

Thanks,

Dharmbir

|||

You are right. OLE DB connection manager uses native connections internally and the AcquireConnection method does not know how to cast it to managed OleDbConnection.

You may try if the following will give you the managed connection:

oleDbConnection = ((IDTSConnectionManagerDatabaseParameters90)connectionManager.InnerObject).GetConnectionForSchema() as OleDbConnection;

However, I am not confident you can use it in the execution time.

HTH.

|||

Hi Bob,

thanks a lot. it really worked fine.

now i have one more issue regarding the connection informaction. I am using OracleConnection at runtime and for this reason i want to fetch the user id, password and datasource information from the connectionstring of OledbConnection. but the connection string doesn't exposes the password.

Can you please help me out for this?

Thanks,

Dharmbir

|||There is no way to get a password from a connection manager because it is a sensitive information. I would go with limiting your component to only use ADO.NET OLE DB connections (the one you can get using AcquireConnection) or provide a way for the users to enter missing passwords.|||

Hi All!

I have a problem with AcquireConnection in c#... I wrote this code:

public override void AcquireConnections(object transaction)

{

if (ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager != null)

{

ConnectionManager cm = DtsConvert.ToConnectionManager(ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager);

ConnectionManagerAdoNet cmAdo = cm.InnerObject as ConnectionManagerAdoNet;

if (cmAdo == null)

throw new Exception("The ConnectionManager " + cm.Name + " is not an ADO connection.");

this.conn = cmAdo.AcquireConnection(transaction) as OracleConnection;

}

but the 'conn' is ALWAYS null...

I try

this.conn = ((IDTSConnectionManagerDatabaseParameters90)cmAdo).GetConnectionForSchema() as OracleConnection;

too, but no result: the 'conn' is null again...

Nobody help me?

Martina

AcquireConnection returns null

Hi,

we are facing some issue to get the underlying OledbConnection from the runtime ConnectionManager.

below is the code sample that we are using

IDtsConnectionService conService = (IDtsConnectionService)this.serviceProvider.GetService(typeof(IDtsConnectionService));

if (conService == null)

return;

ArrayList conCollection = conService.GetConnectionsOfType("OLEDB");

for (int count = 0; count < conCollection.Count; count++)

{

string conName = ((ConnectionManager)conCollection[count]).Name;

if (conName == conMgrname)

{

conMgr = DtsConvert.ToConnectionManager90((ConnectionManager)conCollection[count]);

ConnectionManager cm = DtsConvert.ToConnectionManager(conMgr);

Microsoft.SqlServer.Dts.Runtime.Wrapper.ConnectionManagerAdoNet cmado = cm.InnerObject as Microsoft.SqlServer.Dts.Runtime.Wrapper.ConnectionManagerAdoNet;

OleDbConnection conn= cmado.AcquireConnection(null) as OleDbConnection;

}

}

In the sample above the conn is null.

To this query Darren replied to use the connection of type ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 to create the connection.

Your call to GetConnectionsOfType("OLEDB"); will return native OLE-DB connections, not ADO.NET connections, using the OleDbConnection.

The connection type for the ADo>NET OLE-DB connection is -

ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

but if user creates an New OLEDB Connection from the Connection Manager panel of the BIDS and selects the same from the custom UI how to get the underlying OLEDBConnection? the CreationName in this case is "OLEDB" and not ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.

Replace the code inside the if branch with this:

ConnectionManager cm = conCollection[count] as ConnectionManager;

OleDbConnection conn= cm.AcquireConnection(null) as OleDbConnection;

HTH.

|||

Hi bob,

It still returns me null.

Thanks,

Dharmbir

|||

You are right. OLE DB connection manager uses native connections internally and the AcquireConnection method does not know how to cast it to managed OleDbConnection.

You may try if the following will give you the managed connection:

oleDbConnection = ((IDTSConnectionManagerDatabaseParameters90)connectionManager.InnerObject).GetConnectionForSchema() as OleDbConnection;

However, I am not confident you can use it in the execution time.

HTH.

|||

Hi Bob,

thanks a lot. it really worked fine.

now i have one more issue regarding the connection informaction. I am using OracleConnection at runtime and for this reason i want to fetch the user id, password and datasource information from the connectionstring of OledbConnection. but the connection string doesn't exposes the password.

Can you please help me out for this?

Thanks,

Dharmbir

|||There is no way to get a password from a connection manager because it is a sensitive information. I would go with limiting your component to only use ADO.NET OLE DB connections (the one you can get using AcquireConnection) or provide a way for the users to enter missing passwords.|||

Hi All!

I have a problem with AcquireConnection in c#... I wrote this code:

public override void AcquireConnections(object transaction)

{

if (ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager != null)

{

ConnectionManager cm = DtsConvert.ToConnectionManager(ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager);

ConnectionManagerAdoNet cmAdo = cm.InnerObject as ConnectionManagerAdoNet;

if (cmAdo == null)

throw new Exception("The ConnectionManager " + cm.Name + " is not an ADO connection.");

this.conn = cmAdo.AcquireConnection(transaction) as OracleConnection;

}

but the 'conn' is ALWAYS null...

I try

this.conn = ((IDTSConnectionManagerDatabaseParameters90)cmAdo).GetConnectionForSchema() as OracleConnection;

too, but no result: the 'conn' is null again...

Nobody help me?

Martina

Friday, February 24, 2012

Accessing the sample database in Visual Basic .net sqlDataAdapter

I need some help with accessing the sample databases with
the SqlDataAdapter.
After double-clicking on SqlDataAdapter in Visual
Basic .net. I click on new connection and choose
Microsoft Ole DB Provider for SQL Server as the
provider. Then under the connection tab, I enter (local)
as the server name. And Choose Use Windows NT Inegrated
Security. Then under databases in the server, only
master, model, msdb, and tempdb show up. The sample
databases Northwind and pubs don't show up, as well as
the database which I created called Project.
In the SQL Server Enterprise Manager, under Console Root -
> Microsoft SQL Server -> SQL Server Group -> CR304216-
A\Project[WindowsNT] -> Databases
I see master, model, msdb, Northwind, Project, pubs, and
tempdb.
So, why don't I see Northwind, Project, and pubs in the
sqlDataAdapter console?Hi, Sabrina!
I'm fairly new to VB.net, but I'm working hard at learning it each day.
Anyway, have you tried using the "sa" user name (or better yet... just the u
ser name and password to one of the databases you have access to)? I tend t
o not use the Windows security and go with the user name and password provid
ed for SQL Server instead (
I seem to have problems getting connections the other way).
I would try that and see what happens.
Hope that helps.
Rick
-- Sabrina wrote: --
I need some help with accessing the sample databases with
the SqlDataAdapter.
After double-clicking on SqlDataAdapter in Visual
Basic .net. I click on new connection and choose
Microsoft Ole DB Provider for SQL Server as the
provider. Then under the connection tab, I enter (local)
as the server name. And Choose Use Windows NT Inegrated
Security. Then under databases in the server, only
master, model, msdb, and tempdb show up. The sample
databases Northwind and pubs don't show up, as well as
the database which I created called Project.
In the SQL Server Enterprise Manager, under Console Root -
> Microsoft SQL Server -> SQL Server Group -> CR304216-
A\Project[WindowsNT] -> Databases
I see master, model, msdb, Northwind, Project, pubs, and
tempdb.
So, why don't I see Northwind, Project, and pubs in the
sqlDataAdapter console?

Sunday, February 12, 2012

accessing Report using the browser

Hi,
I have created a sample report called Report1 in SSRS 2005. This currently
is running locally on my workstation.
I can even browse to it using the http address i.e. http://localhost/Reports
The question is: How can someone else access this report on my machine. They
can not browse to my machine by typing http://12.32.2.344/Reports
Do I need to do any configuration in my local IIS?
ThanksIf you are on domain just create the other users logins in your reports /
machine and give access and they should be able to see it. Go to
http://localhost/reports and
site settings and give access for your machine or the server access as well
for the same users.
Amarnath
"farshad" wrote:
> Hi,
> I have created a sample report called Report1 in SSRS 2005. This currently
> is running locally on my workstation.
> I can even browse to it using the http address i.e. http://localhost/Reports
> The question is: How can someone else access this report on my machine. They
> can not browse to my machine by typing http://12.32.2.344/Reports
> Do I need to do any configuration in my local IIS?
> Thanks|||Hello,
I am now in the site settings page.
Not sure what to do now. Can you guide me please so that other users can
view the reports on my local machine?
Thanks
"Amarnath" wrote:
> If you are on domain just create the other users logins in your reports /
> machine and give access and they should be able to see it. Go to
> http://localhost/reports and
> site settings and give access for your machine or the server access as well
> for the same users.
> Amarnath
> "farshad" wrote:
> > Hi,
> > I have created a sample report called Report1 in SSRS 2005. This currently
> > is running locally on my workstation.
> > I can even browse to it using the http address i.e. http://localhost/Reports
> > The question is: How can someone else access this report on my machine. They
> > can not browse to my machine by typing http://12.32.2.344/Reports
> >
> > Do I need to do any configuration in my local IIS?
> > Thanks|||Just got to Home-> and properties tab, go for New role Assignment and give
your domain\name and select "Browser" if they just want to see.
Amarnath
"farshad" wrote:
> Hello,
> I am now in the site settings page.
> Not sure what to do now. Can you guide me please so that other users can
> view the reports on my local machine?
> Thanks
> "Amarnath" wrote:
> > If you are on domain just create the other users logins in your reports /
> > machine and give access and they should be able to see it. Go to
> > http://localhost/reports and
> > site settings and give access for your machine or the server access as well
> > for the same users.
> >
> > Amarnath
> >
> > "farshad" wrote:
> >
> > > Hi,
> > > I have created a sample report called Report1 in SSRS 2005. This currently
> > > is running locally on my workstation.
> > > I can even browse to it using the http address i.e. http://localhost/Reports
> > > The question is: How can someone else access this report on my machine. They
> > > can not browse to my machine by typing http://12.32.2.344/Reports
> > >
> > > Do I need to do any configuration in my local IIS?
> > > Thanks|||Since my last post, I think my IIS settings have changed. Now I can not
browse to http://localhost/reports.
Do you think it could be to do with the IIS settings? Can you guide me on
what the properties settings should be for reports and ReportServer please?
This is the error I get (See below):
Object not found!
The requested URL was not found on this server. If you entered the URL
manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Thursday, February 15, 2007 12:50:47
Apache/2.0.54 (NETWARE) mod_jk/1.2.14
"Amarnath" wrote:
> Just got to Home-> and properties tab, go for New role Assignment and give
> your domain\name and select "Browser" if they just want to see.
> Amarnath
>
> "farshad" wrote:
> > Hello,
> > I am now in the site settings page.
> > Not sure what to do now. Can you guide me please so that other users can
> > view the reports on my local machine?
> > Thanks
> >
> > "Amarnath" wrote:
> >
> > > If you are on domain just create the other users logins in your reports /
> > > machine and give access and they should be able to see it. Go to
> > > http://localhost/reports and
> > > site settings and give access for your machine or the server access as well
> > > for the same users.
> > >
> > > Amarnath
> > >
> > > "farshad" wrote:
> > >
> > > > Hi,
> > > > I have created a sample report called Report1 in SSRS 2005. This currently
> > > > is running locally on my workstation.
> > > > I can even browse to it using the http address i.e. http://localhost/Reports
> > > > The question is: How can someone else access this report on my machine. They
> > > > can not browse to my machine by typing http://12.32.2.344/Reports
> > > >
> > > > Do I need to do any configuration in my local IIS?
> > > > Thanks|||"Just got to Home-> and properties tab, go for New role Assignment and give
your domain\name and select "Browser" if they just want to see."
What happens if there is no domain. We are using Novell.
"farshad" wrote:
> Since my last post, I think my IIS settings have changed. Now I can not
> browse to http://localhost/reports.
> Do you think it could be to do with the IIS settings? Can you guide me on
> what the properties settings should be for reports and ReportServer please?
> This is the error I get (See below):
> Object not found!
> The requested URL was not found on this server. If you entered the URL
> manually please check your spelling and try again.
> If you think this is a server error, please contact the webmaster.
> Error 404
> localhost
> Thursday, February 15, 2007 12:50:47
> Apache/2.0.54 (NETWARE) mod_jk/1.2.14
> "Amarnath" wrote:
> > Just got to Home-> and properties tab, go for New role Assignment and give
> > your domain\name and select "Browser" if they just want to see.
> >
> > Amarnath
> >
> >
> > "farshad" wrote:
> >
> > > Hello,
> > > I am now in the site settings page.
> > > Not sure what to do now. Can you guide me please so that other users can
> > > view the reports on my local machine?
> > > Thanks
> > >
> > > "Amarnath" wrote:
> > >
> > > > If you are on domain just create the other users logins in your reports /
> > > > machine and give access and they should be able to see it. Go to
> > > > http://localhost/reports and
> > > > site settings and give access for your machine or the server access as well
> > > > for the same users.
> > > >
> > > > Amarnath
> > > >
> > > > "farshad" wrote:
> > > >
> > > > > Hi,
> > > > > I have created a sample report called Report1 in SSRS 2005. This currently
> > > > > is running locally on my workstation.
> > > > > I can even browse to it using the http address i.e. http://localhost/Reports
> > > > > The question is: How can someone else access this report on my machine. They
> > > > > can not browse to my machine by typing http://12.32.2.344/Reports
> > > > >
> > > > > Do I need to do any configuration in my local IIS?
> > > > > Thanks|||No domain then just give the user name and give the same name on your machine
access from windows as well. So that the user when logs in will have your
machine (or where the reportserver is installed) access.
Amarnath
"farshad" wrote:
> "Just got to Home-> and properties tab, go for New role Assignment and give
> your domain\name and select "Browser" if they just want to see."
> What happens if there is no domain. We are using Novell.
>
> "farshad" wrote:
> > Since my last post, I think my IIS settings have changed. Now I can not
> > browse to http://localhost/reports.
> > Do you think it could be to do with the IIS settings? Can you guide me on
> > what the properties settings should be for reports and ReportServer please?
> >
> > This is the error I get (See below):
> > Object not found!
> > The requested URL was not found on this server. If you entered the URL
> > manually please check your spelling and try again.
> >
> > If you think this is a server error, please contact the webmaster.
> >
> > Error 404
> > localhost
> > Thursday, February 15, 2007 12:50:47
> > Apache/2.0.54 (NETWARE) mod_jk/1.2.14
> >
> > "Amarnath" wrote:
> >
> > > Just got to Home-> and properties tab, go for New role Assignment and give
> > > your domain\name and select "Browser" if they just want to see.
> > >
> > > Amarnath
> > >
> > >
> > > "farshad" wrote:
> > >
> > > > Hello,
> > > > I am now in the site settings page.
> > > > Not sure what to do now. Can you guide me please so that other users can
> > > > view the reports on my local machine?
> > > > Thanks
> > > >
> > > > "Amarnath" wrote:
> > > >
> > > > > If you are on domain just create the other users logins in your reports /
> > > > > machine and give access and they should be able to see it. Go to
> > > > > http://localhost/reports and
> > > > > site settings and give access for your machine or the server access as well
> > > > > for the same users.
> > > > >
> > > > > Amarnath
> > > > >
> > > > > "farshad" wrote:
> > > > >
> > > > > > Hi,
> > > > > > I have created a sample report called Report1 in SSRS 2005. This currently
> > > > > > is running locally on my workstation.
> > > > > > I can even browse to it using the http address i.e. http://localhost/Reports
> > > > > > The question is: How can someone else access this report on my machine. They
> > > > > > can not browse to my machine by typing http://12.32.2.344/Reports
> > > > > >
> > > > > > Do I need to do any configuration in my local IIS?
> > > > > > Thanks