473,801 Members | 2,260 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hello people...help me out..in vb application to oracle connection

15 New Member
hello,

this is the code i wrote for my application to retrieve values,delete values,update values and insert values...

i am havin doubt in delete and retrieve snippets whether it works right. and deletion should ask for the primarykey which is traderid over here and on getting it,it retrieves all details for the particular user and deletes it. i couldnt check out right now as i dont have connection.

'adodc control

Private Sub Adodc1_WillMove (ByVal adReason As ADODB.EventReas onEnum, adStatus As ADODB.EventStat usEnum, ByVal pRecordset As ADODB.Recordset )

End Sub

'reset all values/clear the values

Private Sub Command9_Click( )

firstname.Text = ""
middlename.Text = ""
lastname.Text = ""
sex.Text = ""
city.Text = ""
state.Text = ""
country.Text = ""
mailid.Text = ""
userid.Text = ""
password.Text = ""
traderid.Text = ""

End Sub


'retrieve contents
Private Sub Command1_Click( )

Dim sql As String
sql = "select * from trader;"
'specify format of SQL result and assisgn to ADODC
Adodc1.CommandT ype = adCmdText
Adodc1.RecordSo urce = sql
Adodc1.Refresh

End Sub


'insert records

Private Sub Command3_Click( )

Adodc1.Recordse t.AddNew

Adodc1.Recordse t.Fields("first name") = firstname.Text
Adodc1.Recordse t.Fields("middl ename") = middlename.Text
Adodc1.Recordse t.Fields("lastn ame") = lastname.Text
Adodc1.Recordse t.Fields("sex") = sex.Text
Adodc1.Recordse t.Fields("city" ) = city.Text
Adodc1.Recordse t.Fields("state ") = state.Text
Adodc1.Recordse t.Fields("count ry") = country.Text
Adodc1.Recordse t.Fields("maili d") = mailid.Text
Adodc1.Recordse t.Fields("useri d") = userid.Text
Adodc1.Recordse t.Fields("passw ord") = password.Text
Adodc1.Recordse t.Fields("trade rid") = traderid.Text

Adodc1.Recordse t.Update

MsgBox "Data inserted and updated"
End Sub

'delete records by retriving the details using traderid details and deleting.

sql = "select firstname,middl ename,lastname, sex,city,state, country,mailid, panno,userid,pa ssword,traderid from trader where traderid=&trade rid;"
If Adodc1.Recordse t.EditMode = adEditDel Then
If MsgBox("Do you really want to delete ?", vbYesNo) = vbYes Then
Adodc.Recordset .Delete
End If
End If
Unload Me

End Sub
Sep 4 '07 #1
0 962

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1715
by: Anonymous User | last post by:
Hi, I am working on a mobile application that consists of a number of handheld scanners, an Xml Web service and an Oracle 9i database in a highly secure environment. The .Net Compact Framework application running on the scanners executes Web service methods, which in turn execute Oracle database functions. The Web service and the Oracle database are running on separate servers. The Web service uses the Microsoft OLE DB driver for Oracle....
9
2422
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work. I tried that quickly, but the file is 400 MB, and the the installation asks for all kinds of things in order to install. Now I'm very confused. a) Do you still need ODP.NET with framework 2.0? b) Do you need to download and install other...
6
16794
by: S_K | last post by:
Hi all! I'm writing an ASP.NET web application that uses an Oracle database. I OPEN the Oracle connection by using the following code: if (this.ConnectionString != "") { this.Connection = new OracleConnection(this.ConnectionString); this.Connection.Open();
4
3087
by: kbarber | last post by:
Can someone tell me how to build a C sharp application from a solution that I could then email to someone else?
0
10527
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10057
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6834
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4267
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2963
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.