How To Create A "transaction Logic"
Dec 16, 2009
anyone knows how to create a "transaction logic" whereby calls to a function is rejected if something else is running.
Sub s1()
End Sub
Sub s2()
End Sub
i do not want s1 to run while s2 is running and viceversa, let's assume the time taken for each sub can be very long/short (in other words always changing)
[Code]...
if lock = "free" and get a True as well, so what happens is that both functions are running at the same time but i only wish 1 of them to be performing their stuff at any one time
View 2 Replies
ADVERTISEMENT
Oct 31, 2011
I want to know that do you still need to rollback your transaction if you haven't commit the transaction that was created earlier.
[Code]...
View 3 Replies
May 9, 2011
I get this error at the Commit of a transaction in a desktop application:
This OleDbTransaction has completed; it is no longer usable.
Other posts I have seen with similar error suggests this can occur if it takes a long time, or contains large amounts of data. This is not the case here.Logging tells me it takes 140 ms from Begin to Commit and about 10 commands executed inside the transaction.It is using an Oracle database.This class is a simplified version of my database class:
Class MyDatabase
Private mConnection AS OleDbConnection
Private mTransaction AS OleDbTransaction
[code]....
Is it not allowed to run a select inside a transaction like this? Or can it be done by running the transaction in a specific isolation level (I see that the BeginTransaction method has an optional parameter for doing this) ? ..Or some other sollution..? In my case, it was not a problem to move the select to run before the transaction started, but what if you need to run selects that must run inside the transaction?
View 1 Replies
Apr 29, 2009
I've seen plenty of examples of transactions in the actual store procedure's SQL. But I'm wanting to do the transaction and keep track of it in code. I tried this but it says that my insertcommand's transaction object is null. How can I fix this?
vb Dim conn As SqlConnection = DBConnections.SQLServerConnection
conn.Open()
Dim params(1) As SqlParameter
[CODE]....
View 3 Replies
Aug 15, 2011
I am going mad trying to sort this logict
Public Sub Panels()
If RadPanelSearchCur.Visible = True Then
RadPanelTenant.Visible = False
'RadPanelProp.Visible = False
[code].....
the idea is if one panel is opened the others are closed?
View 3 Replies
Mar 5, 2009
What is this kind of exception?
Error : Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The transaction property of the command has not been initialized..
This one causes the error: Dim oOperation As COperationOutputTypeBS
oOperation = COperationOutputTypeBS.GetOperationOutputType(txtOperationCode.Text)
View 1 Replies
Jun 2, 2011
I got a big problem in using crystal report in vb.net 2005. im creating a sales and inventory system for softdrinks dealer. so i need to create a receipt for every cash or credit transaction of a client. but i dont have any idea how to use crystal report. how can i make a receipt on crystal report in vb.net 2005.
View 4 Replies
Sep 3, 2010
The application uses ADO.NET to invoke sprocs for nearly every database operation. Some of these sprocs also contain a fair amount of domain logic. The data access logic for each domain entity resides in the domain class itself. ie, there is no decoupling between domain logic and data access logic. I'm looking to accomplish the following:
[Code]...
View 2 Replies
Sep 22, 2010
I am getting the following error while handling transaction(Isoloation level is serializable) in Ado.Net."Transaction (Process ID 75) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."
View 3 Replies
Jan 19, 2012
In many of the articles I have read on the web say that when creating properties in vb.netthey should use the get/set methods and a private/protected member variable in the class.
Like so:
Public Class Person
Private _name as string
[code].....
View 3 Replies
May 1, 2009
in my page Having 4 Buttons ..(FIRST,PREVIOUS,NEXT,LAST) ..i am confusing to this one..
Actually what i am doing is Iam developing one efrom Designer in this user is adding pages..
so We have given These Buttons (before told)..so user click on First Button page goto Starting page and When click on Next Button Goto Next page ..like this
View 5 Replies
Oct 15, 2010
I have 3 tables:Sales data - SaleID, Date, StoreID, CategoryID, Cost, Retail
Store names - StoreID, Name
Category names - CategoryID, Name
I have a dgv bound to my sales table, and 2 comboboxes, one each bound to the remaining tables, with display member set to the name, and value member to the ID.
An ID of -1 represents "All Stores" or "All Categories"
An ID > -1 represents a specific location or category
So, can I use some sort of If,Then,Else logic to do something like this:
SELECT (*) FROM Sales
WHERE (IF @StoreID > -1 THEN StoreID = @StoreID ELSE True)
AND (IF @CategoryID > -1 THEN CategoryID = @CategoryID ELSE True)
AND Date BETWEEN @Date1 AND @Date2
I've found some different examples of If/Then/Else and Select Case type logic for SQL using google, but they don't seem to fit my situation, and I'm not sure how to apply that to what I'm attempting here.
View 2 Replies
May 20, 2010
Can I code to add transaction for some subs? If there is an error in any sub will roll back.For example,
sub1 delete some tables
sub2 insert data into tables which just be deleted
sub3 send out confirmation email
sub4 make submit button disable
I knew that transaction will work for sub1 and sub2 but I do not know if transaction will work for all of subs
View 1 Replies
May 24, 2012
I searched araound and having some difficulties in implementing one scenario with SQL Server 2000 and sybase.I have two SQL servers on different locations naming ServerA (MSSQL Server) and ServerB (Sybase server).I have a table called SALARY.Whenever I insert one record to customer SALARY in ServerA, I also will insert it into ServerB.If should any of them failed, both of them should be rolled back.I am using Asp .Net with VB for the programming.I do not have the right to change / add table in Server B. The only thing allowed in Server B is insert/delete/update record.I looked around and find a method to use TransactionScope but I am not quite sure it is the right way to do.url...
View 1 Replies
Sep 27, 2011
I've found my current side project has become a great learning experience and have decided to keep it going that way. What I'm trying to do is update a table from a DataTable. The datatable has been created and isn't a direct result of a
query otherwise I'd just use a update and not learn anything new. This is what I have for code thus far[code]...
View 2 Replies
Jun 12, 2011
I'm having a hard time on using Transaction then after that I need to use sqldataadapter. When I tried the code below I'm having an error "ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized." Pointing to this block.[code...]
View 1 Replies
Mar 4, 2012
I've got a problem when I'm trying to refresh my form. I've narrowed it down to why I'm getting this error so I'd be interested to hear people's opinions because logically, I don't think I'm approaching this the correct way.
I read from a table that gets x number of records. From the results, I create dynamic check boxes. It's OK if x is greater than the previous refresh but when it's less than, I can still see the old objects.
If I completely close the form and re-open it, it works fine and that is exactly what I'm trying to emulate. However, I'm failing miserably. Here's a broken down version[code]...
View 5 Replies
Oct 14, 2009
I have a datafield [Money] of datatype float.when i input currency value with $,or , it throws an error.How do I allow $ or "," to this field without changing the datatype(I know changing to type money may fix it)
View 3 Replies
Feb 28, 2011
While building an xml document I require to use logic to dictate the outcome of the xml; logically it is similar to the following piece of code (although this does not work):
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
I have managed to do this using the method show below, is this the suggested way of doing this or is there a better one??
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
View 1 Replies
May 2, 2010
How can i write logic to check is it my sql statement being insert into my database ? is there any ways to create or thing can check thru by using webservice?
View 13 Replies
Apr 10, 2012
I want to create a logic to calculate the age and unit from entered birth date. eg: If the difference between birth date and current date is >= 24 months, I will want it to display the age in years. If >= 8 weeks, I will want it to display it in months and so on here's my code
[Code].....
View 9 Replies
May 26, 2010
I have been programming in vb6 for few time ago and i used open SQL Server connection and command objects to make database transactions. I have been searching for similar approaches in vb.net too but not finding any starting point. How can we work similarly in vb.net application?
View 2 Replies
Jan 26, 2011
I never used POCOs, so I have the habit of putting a lot of logic in my business object classes. Hence I believe I'm missing some important concepts about class-layouts, and the thought-process that is needed here.
Say if you have two classes; Company and Employee. Could you give some examples of what classes you would build "around" these that take care of various behavior/validation etc.? (Like some class names, and a brief description of their purpose)
View 2 Replies
Apr 30, 2012
Looking at the following
Instead of a message box, how can I make it round when the unit price field is tabbed off of. If they tab in to the unit price field don't round, if they tab out of it, do.
Private Sub UnitPrice_LoseFocus(AllowLoseFocus As Boolean)
' Runs logic to round unit prices with long decimals
' Enter price rounding here
[Code]....
View 2 Replies
Apr 5, 2009
I want to be able to call forth hundreds of different photos be selecting them from a listbox or something of that nature.
Normally, if I only had a few images, I would amke their visibility false and then use If statements to turn on their visibility once it is selected. However, putting hundreds of images on to a form and then changing their visibility, seems like a pain.
I was wondering if there is a way to call forth each photo within the resources folder when an item is clicked so I don't have to put each one directly on the form.
View 5 Replies
Mar 17, 2009
I'm sure this should be easy but I'm having trouble getting my head around it. I shall try to explain what I need as best I can.I have a string called SoftwareGroupName. If that string is empty, I need to run some code that logs a call in our Helpdesk. So far, so simple.I then check two other variables, AuthorityLevel and InstallType. If the AuthorityLevel is anything other than "OnRequest" then a call is logged in the Helpdesk System. Again, so far, so simple.
The problem occurs when the AuthorityLevel is "OnRequest". At this point, the application should again log a call in the Helpdesk Call with a status of "Resolved" as well as add the user to the relevant group in Active Directory.What I need to be able to do is, effectively, say "If the AuthorityLevel is OnRequest and SoftwareGroupName is not empty then go ahead and create the call and update the group. However, if softwaregroupname is empty then DON'T even try and update the group and create a call with a different status (e.g. Assigned).Here's what I'm doing so far. But it seems wrong to have to check that SoftwareGroupName is empty twice.
[Code]...
View 4 Replies
Oct 7, 2009
We have a system were a user chooses a combination of days from a calander. We then insert a values in the databse based on the following [code]So if they picked Monday and Friday we would insert 34, or if they picked Monday,Tuesday and Thursday we would insert 22.Now my question is how do I reverse this easily in code, to find out what days they have picked. So I get fed 22 from the database how do I figure out what combination of days make up that value. The only thing I can think of is creating the mother of all case statements but I know there must be a better way.
View 4 Replies
Mar 7, 2012
While working on some functions that update my database, I was writing some quick tests just to make sure my functions were executing properly. When it comes time to actually update the database I can pass a transaction to a function and then commit it:
user.Assignment("assignment value for some column in table", connection, transaction)
transaction.Commit()
I am curious if there is a way to write a quick test that can verify that the transaction will actually update certain rows before committing?
(pseudoish-code)
user.Assignment("assignment value for some column in table", connection, transaction)
If Not transaction["SomeColumn"] = "Expected value for SomeColumn"
assert("ColumnName was not going to be updated to the expected value!")
transaction.Rollback()
View 2 Replies
Mar 20, 2012
In my project i am using begin transaction commit or rollback changes. but this causes lock to the tables in that particular functionality.
So if the any other user does any other functionality those locked table are not available until the transaction is completed. I want to know if there is any alternative to transaction which insures data security but the tables are not locked out.
View 1 Replies
Jun 21, 2010
i am building a transaction called client search the location of movie in store which mean client search the movie then get the direction of the movie where it is located in store. So now i need to build classes for this transaction which i am unable to find it because i am confuse about direction table .
View 1 Replies