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
4 2974 KevinADC 4,059
Recognized Expert Specialist
Wrong forum, hopefully a moderator will move your thread shortly.
Wrong forum, hopefully a moderator will move your thread shortly.
hello mr.kevin, i asked whether anyone cud help me out in viewing the records and also deletion and updation..i asked to verify and help me out not tell anythin like your thread will be moved. please help me out people
Invert this code -
firstname.Text = Adodc1.Recordset.Fields("firstname")
-
middlename.Text = Adodc1.Recordset.Fields("middlename")
-
lastname.Text = Adodc1.Recordset.Fields("lastname")
-
--------------------
-
-------------
-
---------
-
--
use four command button and write code for
Move Next
Move Previous
Move First
Move Last
Now, by clicking the commands you can view record in text box
To delete
ADODC1.RecordSe t.Delete (which is the text boxes) -
Adodc1.Recordset.Edit
-
-
Adodc1.Recordset.Fields("firstname") = firstname.Text
-
Adodc1.Recordset.Fields("middlename") = middlename.Text
-
Adodc1.Recordset.Fields("lastname") = lastname.Text
-
Adodc1.Recordset.Fields("sex") = sex.Text
-
Adodc1.Recordset.Fields("city") = city.Text
-
Adodc1.Recordset.Fields("state") = state.Text
-
Adodc1.Recordset.Fields("country") = country.Text
-
Adodc1.Recordset.Fields("mailid") = mailid.Text
-
Adodc1.Recordset.Fields("userid") = userid.Text
-
Adodc1.Recordset.Fields("password") = password.Text
-
Adodc1.Recordset.Fields("traderid") = traderid.Text
-
-
Adodc1.Recordset.Update
This is the concept. Try your best.
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
After reading the TradeID, u have to find it in the ADODC, if found, then Delete, and then Refresh.. Something like this : -
ADODC1.RecordSet.MoveFirst
-
ADODC1.RecordSet.Find "tradeID=" & TradeID
-
If Not ADODC1.RecordSet.EOF Then
-
ADODC1.RecordSet.Delete
-
ADODC1.RecordSet.Refresh
-
ADODC1.RecordSet.MoveFirst
-
Else
-
Msgbox "Trade ID Not Found"
-
End If
-
REgards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Harry |
last post by:
Using Oracle 8i enterprise on win 2000 (sp3)
Installed the standard configuration & whenever I make a connection it
takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason
there for slowness.
Once I'm connected the queries work pretty much instantanously but to
connect using SQLPLUS, Toad, ODBC, OLEDB all take about 10 secs. I
connect using OLEDB from Visual Basic development environment & after
the 1st connection...
|
by: Andrew Arace |
last post by:
I scoured the groups for some hands on code to perform the menial task
of exporting table data from an Access 2000 database to Oracle
database (in this case, it was oracle 8i but i'm assuming this will
work for 9i and even 10g )
No one had what I needed, so I wrote it myself.
I Rule.
This code isn't going for efficiency, and isn't trying to be dynamic.
It doesn't create the table structure in Oracle, that's up to you. (I
|
by: mcbill20 |
last post by:
Hello all. I just installed Oracle 10g developer tools on a machine
running XP Pro and Office XP. Before this I had just the Oracle 9
client installed. I the previous configuration, I was able to access
any of the Oracle tables on another machine but now I am having
problems. Unfortunately, I don't remember the correct syntax for the
ODBC connect string and I am hoping that is my whole problem.
I am trying to connect to an Oracle 9...
|
by: ʹÃûÑï |
last post by:
ORA-03114: not connected to ORACLE && MS's Bug??
DataBase:Oracle 817
using OracleClient,net framework 1.1
I'm using ADO.Net in C# with Oracle 817.
and following is my public data access class.
using System.Data.OracleClient;
|
by: mingki |
last post by:
Hi Developers,
I am a .Net developer of a Large Online Retailling Company. I would
like to have your help on a Connection Pool issue.
Recently we have developed a Web Application on ODP .Net to work with
Oracle Database 10g. To gain the performance, connection pool enable is
a must. Everything work fine throughout the development period and the
performance is Great, however while the Web Application is deployed to
the production,...
| |
by: ori |
last post by:
Hi,
I have an ASP.Net application hosted in a windows server 2003 (IIS
6.0). The application uses a Oracle Database to retrieve some data
through an Oledb connection. I've set the IIS application pool used by
the application to get recycled when the application consumes too much
memory which it ocasionally does and I don't want the server to hang.
After this I stress the application to know it's performance and
monitor it's...
|
by: amjad |
last post by:
Hi when i try below code
public DataSet GetData(string ConString)
{
OracleDataAdapter da;
DataSet ds = new DataSet();
// Setup connection string to access Oracle 9i
|
by: =?Utf-8?B?QVRT?= |
last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g.
Please help,
I'm trying to write an ASP page to use ADO to run a long query against an
Oracle 10g database, to create tables, if they do not already exist. In terms
of ASP/ADO, that would be fine in a SQL Server Sense by a simply
ASP/Server-Side JavaScript as such:
var cnTemp = Server.CreateObject("ADODB.Connection");
|
by: Amjad Mahmood |
last post by:
I have recently joined a pharmacuetical company as a Manager M.I.S
I have source code of an oracle application developed in 6i by my predecessor. I am unable to take help from him due to some technical reasons.
All I have is the server administration, source code files for oracle clients.
I have to change the main connection password, but if I do so all the users will be unable to logon to the application.
Does this mean that the...
|
by: sudhaoncyberworld |
last post by:
Dear Techies,
I do have small issue on connecting oracle server
from .net
This is the code snippet
public string strConString = "Driver={Microsoft ODBC for
Oracle};Server=myserver;Uid=system;Pwd=mypwd;";
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |