﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Using Strata Frame's connection to the datasource...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 26 Apr 2026 02:52:01 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost7687.aspx</link><description>Hehe, will do.</description><pubDate>Mon, 26 Mar 2007 08:31:34 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2037.aspx</link><description>How do i use the connection to the database that strataframe has made to execute miscellaneous sql? select statements, stored procedures, etc.</description><pubDate>Mon, 26 Mar 2007 08:31:34 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost7682.aspx</link><description>please disreguard above &lt;/P&gt;&lt;P&gt;thanks</description><pubDate>Fri, 23 Mar 2007 14:06:19 GMT</pubDate><dc:creator>Bradley Marston</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost7681.aspx</link><description>I was just wondering&amp;nbsp; if&lt;P&gt;DataBasics.DataSources("").ExecuteStoredProcedure("proc Here")&amp;nbsp; &lt;/P&gt;&lt;P&gt;can be part of a transaction along the lines of&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;BusinessLayer.TransactionBegin(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, Data.IsolationLevel.ReadCommitted)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Me.Customers.Save(True)&lt;BR&gt;Me.Orders.Save(True)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;DataBasics.DataSources("").ExecuteStoredProcedure(Do some processing here)&amp;nbsp; BusinessLayer.TransactionEnd()&lt;BR&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;BusinessLayer.TransactionEnd()&lt;BR&gt;&lt;/P&gt;&lt;P&gt;Catch&lt;/P&gt;&lt;P&gt;&amp;nbsp;BusinessLayer.TransactionRollback()&lt;BR&gt;&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;</description><pubDate>Fri, 23 Mar 2007 14:04:46 GMT</pubDate><dc:creator>Bradley Marston</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5556.aspx</link><description>No problem :)</description><pubDate>Wed, 03 Jan 2007 14:51:45 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5555.aspx</link><description>Awesome, thanks Ben.&amp;nbsp; That should save some heartache at a later date.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Wed, 03 Jan 2007 14:49:09 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5554.aspx</link><description>You can still use the same key with multiple users talking to the same database, because the key is only used on the client side.&amp;nbsp; However, when you add the ES to the mix, the key is used as an identifier by the ES as well, so it would probably be best for you to use a unique key since you're planning on using the ES.</description><pubDate>Wed, 03 Jan 2007 14:43:58 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5553.aspx</link><description>What about with multiple users using the same application on the same database?&amp;nbsp; And what about the Middle Tier when it comes out?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Wed, 03 Jan 2007 14:08:58 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5552.aspx</link><description>It's perfectly fine for all transactions to have the same name.&amp;nbsp; But, you can only have one transaction with a specific name at a time.&amp;nbsp; A transaction's life begins when&amp;nbsp;you call TransactionBegin() and ends when you call TransactionCommit() or TransactionRollback().&amp;nbsp; So, if you need to have more than one transaction open at a time, you'll have to use a unique name for each one (which will almost always happen in a web environment).</description><pubDate>Wed, 03 Jan 2007 14:01:18 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5551.aspx</link><description>This post has helped me a ton.&amp;nbsp; Quick question, is it important to make sure that each transaction has a different name?&amp;nbsp;Ir is it ok to have all Transactions named "MyTrans" or some such.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Wed, 03 Jan 2007 13:56:25 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5504.aspx</link><description>Yes, it throws an exception if an error occurs, so you can use a basic try/catch within your code to handle the error.&amp;nbsp; The error will come back as a SqlException which has all sorts of properties like the ErrorCode and the Errors collection that will give you extended information on the error.</description><pubDate>Tue, 02 Jan 2007 13:51:13 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost5446.aspx</link><description>When using the &lt;FONT color=#008000 size=2&gt;DataBasics.DataSources("")... &lt;/FONT&gt;method of executing stored procedures... how does it handle errors that might occur? Does it throw and exception?&lt;/P&gt;&lt;P&gt;Also... Do you think I need any error handling in my stored procedures or user-defined functions to pass back info to my app or will the info get passed back without them?</description><pubDate>Fri, 22 Dec 2006 09:56:38 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3426.aspx</link><description>Yes, you can do this.&amp;nbsp; Really the only difference is that is sets the connection for you.&amp;nbsp; But yes, you can this this also.</description><pubDate>Mon, 09 Oct 2006 21:23:45 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3418.aspx</link><description>Could you also do it like this? &lt;br&gt;
&lt;br&gt;
                DataBasics.DataSources("").ExecuteScalar(cmd)&lt;br&gt;</description><pubDate>Mon, 09 Oct 2006 15:04:49 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3400.aspx</link><description>I'm glad that worked for you :)</description><pubDate>Mon, 09 Oct 2006 11:53:34 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3396.aspx</link><description>Thanks Ben!</description><pubDate>Mon, 09 Oct 2006 08:51:49 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3392.aspx</link><description>Whenever you use the .DataSource("") to execute a command, it creates a new SqlConnection object to execute your command on.&amp;nbsp; However, when you attach a transaction to a command, you have to use the same connection as the transaction, so, you won't be able to use the ExecuteScalar() or ExecuteStoredProcedure() methods of the DbDataSourceItem when you are using a transaction, you will have to execute the SqlCommand objects directly.&lt;P&gt;'-- Start the transaction&lt;BR&gt;DataBasics.DataSources("").TransactionBegin("MyTrans", Data.IsolationLevel.ReadCommitted)&lt;BR&gt;&lt;BR&gt;'-- Create the command object&lt;BR&gt;Dim cmd As New SqlCommand("STI30PostTempDetailsToPOOrderDetails")&lt;BR&gt;cmd.CommandType = Data.CommandType.StoredProcedure&lt;BR&gt;cmd.Transaction = CType(DataBasics.DataSources("").Transactions("MyTrans"), SqlTransaction)&lt;BR&gt;cmd.Connection = CType(DataBasics.DataSources("").Transactions("MyTrans").Connection, SqlConnection)&lt;BR&gt;cmd.Parameters.AddRange(lodefaultParams.ToArray)&lt;BR&gt;&lt;BR&gt;'-- Execute the command&lt;BR&gt;Dim returnVal As Object = cmd.ExecuteScalar()&lt;BR&gt;&lt;BR&gt;'-- Create the command object&lt;BR&gt;cmd = New SqlCommand("STI30DeleteRecordsFromSTItmpPODetails")&lt;BR&gt;cmd.CommandType = Data.CommandType.StoredProcedure&lt;BR&gt;cmd.Transaction = CType(DataBasics.DataSources("").Transactions("MyTrans"), SqlTransaction)&lt;BR&gt;cmd.Connection = CType(DataBasics.DataSources("").Transactions("MyTrans").Connection, SqlConnection)&lt;BR&gt;cmd.Parameters.AddRange(lodefaultParams.ToArray)&lt;BR&gt;&lt;BR&gt;'-- Execute the command&lt;BR&gt;returnVal = cmd.ExecuteScalar()&lt;BR&gt;&lt;BR&gt;'-- Commit the transaction&lt;BR&gt;DataBasics.DataSources("").TransactionCommit("MyTrans")</description><pubDate>Mon, 09 Oct 2006 08:13:12 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3369.aspx</link><description>Ok, thanks for the heads up.</description><pubDate>Fri, 06 Oct 2006 13:55:13 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3368.aspx</link><description>I will have to set this up and look at it closer.&amp;nbsp; It will more than likely not be until Monday until I can look at this in more detail with a sample.&amp;nbsp; Thanks.</description><pubDate>Fri, 06 Oct 2006 13:52:30 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost3364.aspx</link><description>I'm trying to use a transaction with two stored procedures and its not working correctly. Here is the error message I get and the code below I am trying to execute. I've bolded the line of code that it stops on.&lt;br&gt;
&lt;br&gt;
The transaction is either not associated with the current connection of has been completed.&lt;br&gt;
&lt;br&gt;
[code]&lt;br&gt;
'-- Start the transaction&lt;br&gt;
DataBasics.DataSources("").TransactionBegin("MyTrans", Data.IsolationLevel.ReadCommitted)&lt;br&gt;
&lt;br&gt;
'-- Create the command object&lt;br&gt;
Dim cmd As New SqlCommand("STI30PostTempDetailsToPOOrderDetails")&lt;br&gt;
cmd.CommandType = Data.CommandType.StoredProcedure&lt;br&gt;
cmd.Transaction = CType(DataBasics.DataSources("").Transactions("MyTrans"), SqlTransaction)&lt;br&gt;
cmd.Parameters.AddRange(lodefaultParams.ToArray)&lt;br&gt;
&lt;br&gt;
'-- Execute the command&lt;br&gt;
[b]DataBasics.DataSources("").ExecuteScalar(cmd)[/b]&lt;br&gt;
&lt;br&gt;
'-- Create the command object&lt;br&gt;
cmd = New SqlCommand("STI30DeleteRecordsFromSTItmpPODetails")&lt;br&gt;
cmd.CommandType = Data.CommandType.StoredProcedure&lt;br&gt;
cmd.Transaction = CType(DataBasics.DataSources("").Transactions("MyTrans"), SqlTransaction)&lt;br&gt;
cmd.Parameters.AddRange(lodefaultParams.ToArray)&lt;br&gt;
&lt;br&gt;
'-- Execute the command&lt;br&gt;
DataBasics.DataSources("").ExecuteScalar(cmd)&lt;br&gt;
&lt;br&gt;
'-- Commit the transaction&lt;br&gt;
DataBasics.DataSources("").TransactionCommit("MyTrans")&lt;br&gt;
[/code]</description><pubDate>Fri, 06 Oct 2006 12:47:54 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2458.aspx</link><description>If you need manual access to a transaction, you will need to create the transaction and create the SqlCommand objects manually and execute them like this:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- Start the transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;DataBasics.DataSources(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;).TransactionBegin(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;"MyTrans"&lt;/FONT&gt;&lt;FONT size=2&gt;, Data.IsolationLevel.ReadCommitted)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Create the command object&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; command &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlCommand(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;"STI30PostTempTagsToInventory"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.CommandType = Data.CommandType.StoredProcedure&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.Transaction = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(DataBasics.DataSources(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;).Transactions(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;"MyTrans"&lt;/FONT&gt;&lt;FONT size=2&gt;), SqlTransaction)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Execute the command&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;DataBasics.DataSources(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;).ExecuteScalar(command)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Commit the transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;DataBasics.DataSources(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;).TransactionCommit(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;"MyTrans"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Catch&lt;/FONT&gt;&lt;FONT size=2&gt; ex &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Exception&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataBasics.DataSources(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;).TransactionRollback(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;"MyTrans"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Try&lt;/FONT&gt;</description><pubDate>Thu, 24 Aug 2006 15:01:30 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2457.aspx</link><description>Is it possible for me to bind these to a transaction and roll them back if any of them fail? I wasnt sure if StrataFrame supports transactional updates. &lt;br&gt;
&lt;br&gt;
            DataBasics.DataSources("").ExecuteStoredProcedure("STI30PostTempTagsToInventory", DbCommandExecutionType.ExecuteNonQuery, loParams.ToArray)&lt;br&gt;
                    DataBasics.DataSources("").ExecuteStoredProcedure("STI30CreateProductionCosts", DbCommandExecutionType.ExecuteNonQuery, loParams.ToArray)&lt;br&gt;
&lt;br&gt;
Thanks</description><pubDate>Thu, 24 Aug 2006 14:53:32 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2441.aspx</link><description>Imports MicroFour.StrataFrame.Data&lt;/P&gt;&lt;P&gt;DataBasics.DataSources("").ExecuteStoredProcedure("STI80CreateTagsInInvTempTable", _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DbCommandExecutionType.ExecuteScalar, loParams.ToArray)&lt;/P&gt;&lt;P&gt;Will work fine.&amp;nbsp; That method will return an object.&lt;BR&gt;&lt;BR&gt;</description><pubDate>Thu, 24 Aug 2006 13:59:26 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2435.aspx</link><description>How do I convert this statement to work like the one below it? So that an object is returned?&lt;br&gt;
&lt;br&gt;
MicroFour.StrataFrame.Data.DataBasics.DataSources("").ExecuteScalar().ExecuteStoredProcedure("STI80CreateTagsInInvTempTable", MicroFour.StrataFrame.Data.DbCommandExecutionType.ExecuteScalar, loParams.ToArray)&lt;br&gt;
&lt;br&gt;
Dim oResult As Object = SqlHelper.ExecuteScalar(CONNECTION_STRING, CommandType.StoredProcedure, "STI40GetProductID", ProductIDParams.ToArray)&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 24 Aug 2006 13:16:38 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Using Strata Frame's connection to the datasource...</title><link>http://forum.strataframe.net/FindPost2125.aspx</link><description>Yes, it should have throw an SqlException indicating that a required parameter was not supplied... The stored procedure itself wouldn't have caused an error because it never would have even been executed.&amp;nbsp;</description><pubDate>Tue, 08 Aug 2006 13:10:18 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>