Transactionscope Not Working On SQLite In Subsonic?

Jul 24, 2009

I have trouble using the transactionscope on SQLite, i am using the following code. Changes are still commited to the database while i don't call the ts.Complete() function.

Using ts As New System.Transactions.TransactionScope()
Using sharedConnectionScope As New SubSonic.SharedDbConnectionScope()
' Do your individual saves here'

[Code].....

View 2 Replies


ADVERTISEMENT

SubSonic Save() Changes Not Working?

May 3, 2011

I am trying to save changes to a record, however I am getting the error

[code]...

View 1 Replies

SqlException Inside TransactionScope?

Jan 21, 2011

I'm currently working on a legacy project in VB.NET 2.0.The project has a very funny DAL-layer which does not incorporate transactions :-|Anyway, it's my job to make some parts of the program transactional and I don'thave access to the DAL layer code.So I'm trying to put entire sections of code inside single TransactionScope.

View 1 Replies

TransactionScope And Error: ORA-02049?

Oct 26, 2009

I have the following routine:

[code]...

Running this against both our production and test Oracle 11g database sporadically (or if there is a pattern, I haven't found it yet) generates the Oracle Error:ORA-02049: timeout: distributed transaction waiting for lock Since this is the only process running against the test database, there shouldn't be any issue with different users competing for a lock.

View 1 Replies

What Is The Equivalent Of TransactionScope In VB 2008/ ADO .NET 3.5

May 1, 2010

I came accross TransactionScope as I try to resolve an issue bothering on the use of Transactions on Typed DataSets. But when I tried to implement it, my intellisence does not recognise it. I have to Import System. Transaction. TransactionScope but it is not recognised. How do I use it cos it seems like it holds some clues to my problem?Only performance counts!

View 5 Replies

Using Subsonic With .net?

Oct 4, 2010

I'm quite comfortable with VB and have a very large project i need to do. I've come across SubSonic and it looks awesome. I am not clear if i can use it in VB. I've seen a a couple of posts that suggest they did but on the site it specifically shows C#.Can I use SubSonic with VB.NET?

View 1 Replies

.net - Instantiating TransactionScope Returns Null?

Nov 21, 2009

I have some VB.NET code that creates a TransactionScope instance:

LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "About to associate call data with contracts")
Using ts = New TransactionScope()
LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "Getting all unimported SatCom calls")

My application is throwing an exception on the call to the creation of a new TransactionScope, with "Object reference not set to an instance of an object.". The exception isn't thrown on my development machine or my test machine; only on the customers production machine, and I have no idea why. I've placed debug lines immediately before and after this line so I'm positive it is this line causing the problem.

A have used TransactionScopes throughout the application and this is the only place throwing the exception on the client machine."About to associate call data with contracts" gets written to the log and the next log entry is the "Object reference not set to an instance of an object".

Code works fine if I move it out of a transaction.I've been struggling with this for 4 days now and have got no closer.

View 1 Replies

Hangs With LINQ-SQL Server And TransactionScope

Mar 17, 2010

I'm encountering a hang when the program tries to access the fruit database. I've already enabled network access MSDTC on both my development computer and the SQL Server server.

[Code]...

View 1 Replies

Microsoft ODBC For Oracle With TransactionScope?

Jul 9, 2011

I use Microsoft ODBC For Oracle, and process a distributed transaction with ransactionScope, but, the code throws a error: ERROR [HYC00][ORACLE][ODBC]option not implement, my code is in vb.net.ere is my code:

sub Main()
dim strConn1 as string = "Driver={Microsoft ODBC for Oracle};Server=server1;UID=user1;PWD=pwd1;"

[code].....

View 2 Replies

Setting The Database Connection When Using A TransactionScope?

Apr 26, 2010

Does the database connection have to be set inside a TransactionScope?

Or can I set it in the ctor and then have instance methods create up a TransactionScope?

EDIT: e.g.

Public Sub New()
Dim conn = new SqlConnection(...connection string)
Public Sub SomeClassMethod()

[Code].....

the question is do you need to create the connection to the database after you've created a TransactionScope or can it be done before?

View 1 Replies

Asp.net - Subsonic With Webservice?

May 6, 2009

I am trying to get subsonic to run work in a webservice I am not sure how to return the data. I only get the word Object in my results when It return anything instead of values. What am I missing?

<WebMethod(Description:="Method to retrieveCptCode subsonic List")> _
Public Function GetSubCptCodes() As CPTCodeCollection
Dim coll As CPTCodeCollection = New CPTCodeCollection()
Dim qry As Query = New Query(CPTCode.Schema)
coll.LoadAndCloseReader(qry.ExecuteReader())
Return coll
End Function

View 1 Replies

C# - Subsonic 3 - Namespace Hidden

Apr 17, 2009

Followed Rob's webcast, did as he did, watched T4 generate the code, went to use the new namespace and oh. No namespace. I can see the namespace Test.Data in each of the generated .cs files, the tt files are included in the project as is subsonic.dll, there are no errors (I managed to get rid of a warning for the duplicate directives) but I just can't see the namespace. To test it out I am building a simple vb.net console application so wondering if there is a conflict there. Using v2.2 against the same db works fine.

View 1 Replies

Subsonic Can't Find By String

Jul 17, 2009

[code] will both give the error "The method 'CompareString' is not supported". If I make the same call searching for an integer (ID field) it works fine. .SingleOrDefault (Function(x As Account) x.Id = 12)So interger matching is fine but strings don't work Is this a problem with the VB.net templates?

View 3 Replies

Use SubSonic In Program Web Application?

May 18, 2009

I am using Subonic in a VB.net application for the first time (I have used it succesfully in a WebSite project plenty of times). I followed the 2nd part of the 'Getting Started' video to actually generate the DAL source files as opposed to the build provider method and everything APPEARS to have gone like expected. However, nothing I do will get my generated namespace to appear. I feel that it has to with the fact that I am running my Web Application in VB.Net and Subsonic generates in C#.

Here is the process I followed:

1) I created a blank Web Application Project in Visual Studio

2) I configured the web.config to have the necessary parts, connection strings, etc.

3) I ran subcommander and it generated all the classes I needed into a folder called DAL.

4) I built the Web Application Project

5) I opened up a code behind, typed 'Imports' and I do not see the namespace that was generated.

I have even opened the actual Subsonic Source files and seen that there is a namespace statement for the generated namespace I configured. I tried briefly to move the subsonic files to a separate class library project, compile the .dll and use that in my project, but it still did not work.

View 2 Replies

Unable To Open A Connection Inside TransactionScope Block?

Dec 1, 2009

I'm trying to incorporate TransactionScope into my code and am failing at the first hurdle. I am unable to open a connection inside TransactionScope block. I get exception Connection Not Open.

Public Sub PerformDBWork()
Dim cnA As New OleDbConnection(My.Settings.DB_CONN_BUSINESS)
Try
cnA.Open()

[code].....

My cnA.Open() fires as expected but my call to cnBusinessDB.Open() fails.

View 5 Replies

Subsonic And The .net 2005 Interop Toolkit?

Nov 10, 2009

I have an application I am converting over from vb6 to vb.net 2.0/3.5. Using Subsonic 2.2 and the vb.net Interop Toolkit 2005. Cannot seem to get the .net form using subsonic to work inside the interop environment.It keeps saying it cannot find the subsonic service provider in the app.config. But I know it is there. Has anyone used these two toolkits together successfully? Will subsonic even work inside the interop environment in that way?

View 1 Replies

.net - Subsonic 3.0 - Separate Generated Code From ActiveRecord.vb?

May 18, 2010

I moved from SubSonic 2.x to 3.0 and noticed that all my classes are combined into the ActiveRecord.vb(cs) file. Is there a way to have my classes generated individually in a separate folder (DAL) as I was doing with 2.x?

View 2 Replies

C# - Use SubSonic Or Dynamic Data For A New CRUD Asp.net Application?

Mar 3, 2009

I need to throw together a quick CRUD asp.net site, but this may become a bigger application down the road. I have some experience with SubSonic, but it has been so long since I did a project with it I have to relearn it. I am also considering using Dynamic Data.

View 5 Replies

InvalidCastException When Generate Code Via Subsonic With A Web Site?

Dec 10, 2009

I'm trying to use Subsonic 3.0.0.3 with an existing web site created in vb.net. I've added a reference to SubSonic.Core.dll and added the ActiveRecord tt/ttinclude files. I also added a contextmenu entry to run the t4 templates using instructions I found here.Whenever I try to run any of the tt files, I receive the following exception. Does this have something to do with me using a web site as opposed to a web application?

f:Documents and SettingsdbollardLocal SettingsTempSQLServer.ttinclude(85,15) : warning CS0219: Compiling transformation: The variable 'parameters' is assigned but its value is never used
ActiveRecord.tt(0,0) : error : Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost' to type 'System.IServiceProvider'.

[Code]...

View 1 Replies

Subsonic 3 Work Virtual Basic .net Project?

Sep 15, 2009

i download subsonic 3 today (subsonic 3 preview 2) but this don't work in vb project.i think because .tt file (for generation) is C# template so this don't generate vb code.

View 1 Replies

Using TransactionScope - Windows Service That Reads From An Excel Spreadsheet And Imports Records Into A SQL Server 2000 Database Table

Oct 30, 2007

I have a simple Windows Service that reads from an Excel spreadsheet and imports the records into a SQL Server 2000 database table. Before it loads it checks if the file has been successfully imported before (using filename) and whether any of the records in the file have been imported before (using primary key). If these checks are ok I load the records into a datatable and then update the datatable to the database.

However, I need to do this in a transaction as I want to ignore the whole file if there is an error. The file goes to a discarded folder and the user gets an email with why the import failed. (This is likely to be because the store the record is for is not yet added to the database and the referential intergrity of the db fails). If there is no transaction the records before the failure record are imported. When the file is imported again (the store has been added to store table) the file is then rejected because duplicate records are already in the db.

Heres my code:

[CODE]...

View 3 Replies

Returning The Max Value From Sqlite DB?

Feb 22, 2012

I have a SQLite database and I am tyring to query the max value in the RecordID field. This query works when I run it in SQLite but I can not get the VB to return the value, what have I done wrong?

Dim getMaxRecID As String = "SELECT MAX(RecordID) FROM String"
Using cmd1 As New SQLiteCommand(getMaxRecID, pConn)
cmd1.CommandType = CommandType.Text
Dim IDresults As Integer

[code]....

The connection is correctly opening the db, and shows it as open as well. No error, just IDresults returns 0 everytime.

View 1 Replies

Subsonic Invalid Cast From System.Int32 To System.Byte[]

Feb 22, 2010

Subsonic 2.2 is throwing the error

subsonic Invalid cast from System.Int32 to System.Byte[]

When I do the following

If template.Content Is Nothing Then
MsgBox("Blank Document")
Else
MsgBox("Document Present")
End If

"template" is a SubSonic object of which it's "content" field is of type Byte()

View 1 Replies

Replacing DbTransaction Calls With Calls To TransactionScope?

Mar 4, 2010

I have been using DBTransaction for my current projects that access a single database. However, I read some documentation on TransactionScope and was wondering in which scenario would using TransactionScope be better? Or should I be replacing DbTransaction calls with calls to TransactionScope?

View 2 Replies

.net - SQLite And Windows Phone 7.1?

Jan 31, 2012

Depending on what i know, SQLite is supported in WP7.1, but i cant even import System.Data.SQLite to the project should i download it as a dll specially for windows phone or am i missing something?!

View 1 Replies

App That Uses Both An SQLite And MySql Database

May 29, 2012

I am writing an app that uses both an SQLite and MySql database. The reason for this before you ask is that it means I can store a local copy of the data onto my user' own machines when they are offline, and then update them to a central server when they are next online.

The problem I have is that when using datasets (on tables created in identical fashion) the itemarray of the mysql database has 9 extra totally blank fields...where as the SQLite itemarray has only the values for the items.

here is a snippet of the code:

CODE:

ultimately I am getting an index size mismatch error but with both tables having the same number of fields this is confusing.

View 3 Replies

How To Get The Sum Of Values From A SQLite Table

May 9, 2012

I'm trying to Collect Bids and Distribute the average from a Column I'm getting an InvalidCast Exception: Specified cast is not valid. on the TotalSum +=

Dim sql As String = "SELECT " & Column & " FROM " & Table & " ;"
Dim dt As DataTable = SQLiteDatabase.GetDataTable(sql)
Column = Column.Replace("[", "")
Column = Column.Replace("]", "")
For Each row As DataRow In dt.Rows

[Code]...

View 3 Replies

Simple Tutorial On How To Use SQLite

Mar 21, 2010

I'm using VB.NET and MSSQL 2005 to create an application. I was told I should rather use SQLite as I want my application to be a standalone one with embedded database. Can someone please provide me with a step to step tutorial on how to create a standalone application with an embedded database?

View 2 Replies

Sql - Deleting From Sqlite Database Using IN

Jun 22, 2011

i am deleting from an sqlite database using the ids of the records like this the dirID is an array of the IDs Dim i As Integer = 0

[Code]...

the problem is that it dosen't alwasy delete from the database, and its not throwing any errors. Could there be a better way of deleting

View 1 Replies

Sql - Insert If Not Exists In Sqlite With VB

May 25, 2012

I have records from server that I want to copy, so I used datareader to select all, during selection the insert also process. [Code] What is the exact sql statement to insert only if record doesn't exist in my current table? I used some of this code, but a filter was defined: like x. What if I just want to insert records that doesn't exist in the table I want. [Code]

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved