Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old December 6th, 2002, 07:44 AM
iamtgo3 iamtgo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: USA
Posts: 312 iamtgo3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 27 m 43 sec
Reputation Power: 7
Send a message via ICQ to iamtgo3 Send a message via AIM to iamtgo3 Send a message via MSN to iamtgo3 Send a message via Yahoo to iamtgo3
ADO.NET and Checking to see if record exist

What I am trying to do is this we have a couple branch offices that are looking to use a common database with the same program remotely. Now what I am doing is only pulling back one record at a time the one they search for. This will make it easier them pulling all 50,000+ records back at once. I have to figure out when someone wants to create a new record they will have to type in the ClientNumber first and see if it has already been entred if not then it allows them to create the record.

Not PHP code but is a code block so I used it.. *Grin*
PHP Code:
Private Sub GetClientNumberQuery(ByVal stQuery As StringByVal myClientNumber As String)

        Try
            
selectNum 0
            daClients
.Dispose()
            
dsClients.Dispose()
            
ClearTextBoxes()

            
daClients = New SqlDataAdapter(stQuerycnClients)
            
Dim custCB As SqlCommandBuilder = New SqlCommandBuilder(daClients)
            
daClients.UpdateCommand custCB.GetUpdateCommand
            dsClients 
= New DataSet()


            
daClients.Fill(dsClients)

            
dsClients.Tables(0).TableName "Clients"
            
SetNewClientNumber(dsClients.Tables("Clients"), selectNummyClientNumber)
        Catch 
_ex As Exception
            MessageBox
.Show(_ex.ToString)
        
Finally
            Beep
()   ' Beep after error processing.
        End Try

    End Sub

    Private Sub SetNewClientNumber(ByRef dt As DataTable, ByVal selectedNum As Integer, ByVal myClientNumber As String)
        Dim drNew As DataRow

        Dim iCount As Integer
        Dim myTables As New ArrayList()
        '
Dim stString As String

        
Try
            For 
iCount 0 To 20
                
If dt.Rows(selectedNum).IsNull(iCountThen
                    myTables
.Add("")
                Else
                    
myTables.Add(dt.Rows(selectedNum).Item(iCount))
                
End If

            
Next

            TextBox1
.Text myTables(1)
            
lblRecordID.Text myTables(0)
            
TextBox2.Text myTables(2)
            
ComboBox1.Text myTables(3)
            
TextBox3.Text myTables(4)
            
TextBox4.Text myTables(5)
            
TextBox5.Text myTables(6)
            
ComboBox2.Text myTables(7)
            
TextBox6.Text myTables(8)
            
TextBox7.Text myTables(9)
            
TextBox8.Text myTables(10)
            
ComboBox3.Text myTables(11)
            
TextBox9.Text myTables(12)
            
TextBox10.Text myTables(13)
            
TextBox11.Text myTables(14)
            
TextBox12.Text myTables(15)
            
TextBox13.Text myTables(16)
            
TextBox14.Text myTables(17)
            
TextBox15.Text myTables(18)
            
TextBox16.Text myTables(19)
            
TextBox17.Text myTables(20)

            
MessageBox.Show("Record already exist""Record Exist"MessageBoxButtons.OKMessageBoxIcon.Information)
        Catch 
_ex As Exception
            MessageBox
.Show(_ex.ToString"No Records Found"MessageBoxButtons.OKMessageBoxIcon.Information)
            
ClearTextBoxes()

            
dsClients.Clear()

            
drNew dsClients.Tables("Clients").NewRow
            drNew
.Item("ClientNumber") = myClientNumber
            TextBox1
.Text myClientNumber

            dsClients
.Tables("Clients").Rows.Add(drNew)

            
EnableButtons(True)
            
bAddNew True
        Finally
            Beep
()   ' Beep after error processing.
        End Try

    End Sub 
__________________
George - www.ipdg3.com
Helping Developers and Programmers Find Resources
Forums - Contests - Tutorials - Source Code
ORB - Wireless Site - Online Gear

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > ADO.NET and Checking to see if record exist


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway