|
Without seeing your code, it's impossible to tell you how to fix it.
But, in general, you should put the update code in stored procedures in the database and let it worry about the transaction details.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi!
My code is here ! pls, hekp me
=====================
g_trans = g_Conn.BeginTransaction
Me.g_cmd = New OracleClient.OracleCommand
// The first. I hate to insert the header of bill into BillHeader Table
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_TDPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
..........
.ExecuteNonQuery()
End With
// Then, I have to insert detail each Item into Items Table
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_CTPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
...............
.ExecuteNonQuery()
End With
=========
When both procedures successful, I must commit the Transaction ( g_trans.Commit()). But If have some problem, I have to rollback all (g_trans.Rollback())
|
|
|
|
|
Hi!
My code is here ! pls, help me. Thank alot
=====================
// Then, I have to insert detail each Item into Items Table
For i ....
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_CTPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
...............
.ExecuteNonQuery()
End With
Next
=========
When both procedures successful, I must commit the Transaction ( g_trans.Commit()). But If have some problem, I have to rollback all (g_trans.Rollback())
|
|
|
|
|
hello,
can someone teach me how to connect to a database by a manual coding. not the automatic one! I am using an Ms Access 2003. I want to search to the database as well.
Please help me!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Look at what code Visual Studio is creating for you. You can use that as a starting point. You can then change values on the automatic creation and see what differences that makes to the generated code - you will begin to get an understanding of what you need to do to connect to a database using your own code rather than code that Visual Studio has created for you.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi all,
im doing an application in which im reading an excel file,so i just want to count the number of rows and columns in excel file from the vb program .please help me with this.
with regards,
susa
|
|
|
|
|
Rowcount: numRows = xls.Worksheets(1).usedrange.rows.count
Column Count: colRows = xls.Worksheets(1).usedrange.columns.count
Here, xls is Excel Workbook Object which is declared as
Dim xls as Excel.Workbook
|
|
|
|
|
i added this code but im getting error as property or method not supported
help me
hi to all
with regards,
susa
|
|
|
|
|
Can anybody help me to find a solution that how can i convert a binary file that is saved in the database to a word file in the front end part.
Krishna
|
|
|
|
|
There are more than a few documents on the web that describe this, Google results[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have Visual Studio disk , after i installed it, eveything 's almost ok but when it 's near the end of installation (I think).These stuffs appeared :
First alert box:
ssapi.dll was unable to register itself
in the system registry.
Second alert box:
The instruction at "0xffbadd11" referenced
memory at "0xffbadd11". The memory could
not be "read".
Cick on OK to terminate the program.
and when I click ok , then i can use Visual C++ , but when i try Visual Basic, this alert box appeared:
unexpected erro; quitting
Please explain me what happened and how to solve it. I need Visual Basic, i will learn it this semester.
|
|
|
|
|
Is VB98 VB6 ? If so, you're learning a dead language. You should try to find a course in VB.NET, or another language altogether. VB.NET is free, but you can't use it to do VB6.
Are you running as an admin when doing this install ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sounds like you are attempting to install on an unsupported/unpatched system or you are using an old version of VB. Which Visual Studio version are you attempting to install and on what system?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
This is Visual Studio 6.0, and I use Windows Xp Home Edition.
This is the first time I use Visual Studio, can you explain me what difference between Visual Basic, Visual C++ and Visual Sudio.
Sorry for stupiest question.
-- modified at 1:56 Monday 24th April, 2006
|
|
|
|
|
Visual Studio is the "integrated development environment" that provides a consistent look and feel and automates the language compilers. Visual Basic and Visual C++ are programming languages.
VS 6 on XP Home should work ok provided you don't use functions that are not supported on XP Home (e.g. some domain functions or IIS web development).
What you do need is a fully up-to-date patched XP and careful that any prerequisites are installed on your machine.
Also check that the CD you are using is a genuine one and not ripped from somewhere else.
Like Christian said, VB 6.0 is no longer a good choice for development and if you can, use VB.NET instead (Visual Studio 2005 Express is free from Microsoft).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
|
I have finished a application in VB.NET
How can I startup this application in IE by ActiveX ?
The site have all acceess right in client IE.
|
|
|
|
|
ActuveX doesn't open applications. ActiveX is essentially a fancy name for a COM-based component. You can't just open and run any application you want inside a web browser. There are, in most cases, severe restrictions on what you can and cannot do. Also, your component must be written as an ActiveX (or COM) server that Internet Explorer can use.
Did you consider this when writing your component? In VB.NET, there is a bunch of stuff you have to add to your component to expose it to COM properly so that IE can use it.
Exposing .NET Framework Components to COM[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I don't know this and so I never consider about it.
I think my application cannot register for COM Interop,
and the check box in project property is disabled ...
Can you tell me the steps to create one ?
Thank you!
|
|
|
|
|
All I can do is point you at Google. With my wedding comming up in a few weeks, I really don't have the time to teach anyone anything over the web.
This is NOT an easy topic. There is no step-by-step for creating entire applications that will run in IE.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have used GetCaretPos to get the position of caret on any Editable box belong to any application like notepad for example.
the problem is:
I have a timer calling this function every 100 ms, when I run my program and begin to track the caret on any application it works fine.
but if I try to run another application and get the caret's position from it, the GetCaretPos function always points to the caret's position of the old application.
What can I do ??
|
|
|
|
|
First, why are you tracking the caret in any application? I don't see a reason to do this at all...
The system provides a caret for each message queue for a window. This doesn't mean that the caret actually exists! If the window you're trying to get the caret in chooses not to use the system caret, there's really nothing you can do about it.
Also, some applications don't use the system carest at all and implement their own caret. In this case, you're just out of luck. There is no one function that will give you the caret position for every application out there.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank's for valuable information.
About tracking caret. I need to do this because I want to display something like ToolTip box or List
at the caret's position.
If I have two applications support the system caret, can I get the caret position on each of them ?
|
|
|
|
|
Yes. But, GetCaretPos only works on the window that has the focus, or in other words, the window foreground window. You can't specify which window the function should work on.
The coordinates returned are the coordinates relative to the window the caret is in, or the client window, not the absolute screen position of the caret.
If you wanted to get the caret position of any window, you would first have to bring that window to the foreground and give the focus to the window that you wanted to get the caret position from.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to set the myForm.owner to a windows application instance like MS outlook?
For example, Dim oOutlook = new outlook.application,
Is it possible to see the form owner to the ooutlook?
Thanks
|
|
|
|