Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 3 online users. » 1 Member(s) | 1 Guest(s) Google, MorrissgoX
|
Latest Threads |
Looking for Adventure? Fi...
Forum: Random Discussion
Last Post: iHOMEz
11-16-2024, 09:18 PM
» Replies: 0
» Views: 475
|
Prettys Womans in your to...
Forum: Random Discussion
Last Post: iHOMEz
10-30-2024, 07:45 AM
» Replies: 0
» Views: 755
|
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-26-2024, 10:50 AM
» Replies: 0
» Views: 785
|
Beautiful Womans from you...
Forum: Random Discussion
Last Post: iHOMEz
10-19-2024, 02:48 PM
» Replies: 0
» Views: 885
|
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-06-2024, 05:00 PM
» Replies: 0
» Views: 1,046
|
Womans from your city - V...
Forum: Random Discussion
Last Post: iHOMEz
07-28-2024, 10:26 AM
» Replies: 0
» Views: 1,421
|
Supreme Сasual Dating - A...
Forum: Random Discussion
Last Post: iHOMEz
06-14-2024, 11:28 AM
» Replies: 0
» Views: 1,850
|
Beautiful Womans in your ...
Forum: VB.NET
Last Post: iHOMEz
06-09-2024, 09:23 PM
» Replies: 0
» Views: 1,653
|
Hangman in Rust
Forum: Other
Last Post: brandonio21
02-04-2018, 11:14 AM
» Replies: 2
» Views: 20,649
|
How to: Search files from...
Forum: VB.NET
Last Post: brandonio21
11-25-2017, 12:55 PM
» Replies: 1
» Views: 15,962
|
|
|
Help with creating an INSERT statement using MySQL |
Posted by: kismetgerald - 08-29-2012, 10:42 AM - Forum: Programming Help
- Replies (4)
|
|
Guys,
I'm having problems with my MySQL query. VB keeps throwing the following exception:
Quote:The CommandText property has not been properly initialized
Here's the code I'm using:
[code2=vbnet]Dim dbConn As New MySqlConnection("Server=" & FormLogin.ComboBoxServerIP.SelectedItem & ";Port=3306;Uid=parts;Password=parts;Database=accounting")
Dim dbQuery As String = ""
Dim dbData As MySqlDataReader
Dim dbAdapter As New MySqlDataAdapter
Dim dbCmd As New MySqlCommand
Try
If dbConn.State = ConnectionState.Open Then
dbConn.Close()
Else
dbConn.Open()
dbCmd.CommandText = dbQuery
dbCmd.Connection = dbConn
dbAdapter.SelectCommand = dbCmd
dbData = dbCmd.ExecuteReader
dbQuery = "INSERT INTO customer (accountNumber, nameLAST, nameFIRST, nameCOMPANY, addressSTREET, addressSTREET1, addressCITY, addressSTATE, addressZIPCODE, phone, fax, email) VALUES('" & TextBoxAccount.Text & "','" & TextBoxLastName.Text & "','" & TextBoxFirstName.Text & "','" & TextBoxCompanyName.Text & "','" & TextBoxAddress1.Text & "','" & TextBoxAddress2.Text & "','" & TextBoxCity.Text & "','" & ComboBoxState.SelectedItem & "','" & MaskedTextBoxZip.Text & "','" & MaskedTextBoxPhone.Text & "','" & MaskedTextBoxFax.Text & "','" & TextBoxEmail.Text & "')"
End If
Catch ex As MySqlException
MessageBox.Show("Error connecting to database server. Please call the IT/Systems Helpdesk for support." & vbCrLf & vbCrLf & ex.ToString)
End Try
dbConn.Close()[/code2]
Your help would be greatly appreciated, thanks.
|
|
|
How to write string query on multiple lines |
Posted by: kismetgerald - 08-29-2012, 10:06 AM - Forum: Programming Help
- Replies (1)
|
|
Hey guys,
I've built a MySQL query (below) that I'm using in my application. This is a rather long query and I can't figure out how to get it to display in multiple lines using (& _).
[code2=vbnet]dbQuery = "INSERT INTO customer (accountNumber, nameLAST, nameFIRST, nameCOMPANY, addressSTREET, addressSTREET1, addressCITY, addressSTATE, addressZIPCODE, phone, fax, email) VALUES('" & TextBoxAccount.Text & "','" & TextBoxLastName.Text & "','" & TextBoxFirstName.Text & "','" & TextBoxCompanyName.Text & "','" & TextBoxAddress1.Text & "','" & TextBoxAddress2.Text & "','" & TextBoxCity.Text & "','" & ComboBoxState.SelectedItem & "','" & MaskedTextBoxZip.Text & "','" & MaskedTextBoxPhone.Text & "','" & MaskedTextBoxFax.Text & "','" & TextBoxEmail.Text & "')"[/code2]
Your help would be greatly appreciated.
Thanks.
|
|
|
If Authors Were Programmers |
Posted by: brandonio21 - 08-27-2012, 08:45 PM - Forum: Computing
- Replies (1)
|
|
I found this interesting article online describing how various famous authors would write a Fibonacci series generator in JavaScript. It is entitled "If Hemingway Wrote Javascript" and it's a fun and clever read!
<!-- m --><a class="postlink" href="http://byfat.xxx/if-hemingway-wrote-javascript">http://byfat.xxx/if-hemingway-wrote-javascript</a><!-- m -->
|
|
|
Issue with Visual Basic Express Programming: |
Posted by: Zantox - 08-26-2012, 08:56 PM - Forum: Computing
- Replies (3)
|
|
So I have 3 forms inside a project:
1: Login
2: Launchpad
3: Irrelevant but: About
The first one that comes up upon start is "Login"
It has 2 text box forms, with "Username" and "Password"
and then a login button (See code Below)
My problem is, I have it set to if the login information is correct, close the "Login" window and open the "Launchpad" Form. And what happens is, when I fill it out correctly, and click login, it opens launchpad really fast and then closes everything. Please help.
Code: If TextBox1.Text = "a" And TextBox2.Text = "a" Then
Launchpad.Show()
Me.Close()
Else : MsgBox("You have specified an Incorrect Username or Password, Please Try Again. If problems still persist, please contact Support.")
End If
|
|
|
Website Giveaway (August - 2012) |
Posted by: brandonio21 - 08-26-2012, 06:40 PM - Forum: Computing
- Replies (69)
|
|
Please post a reply to this thread with your YouTube username. This will earn you one extra entry in the website giveaway.
For more information, view the video here:
<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=T5_flbG8E4E&feature=youtu.be">http://www.youtube.com/watch?v=T5_flbG8 ... e=youtu.be</a><!-- m -->
This giveaway is over! The results video can be viewed here:
[youtube]pkkWEEEwFgk[/youtube]
|
|
|
Help with Credit Card Validation |
Posted by: kismetgerald - 08-24-2012, 09:24 AM - Forum: Programming Help
- Replies (4)
|
|
Hey guys,
It's me again - still learning vb.net actively and getting lots of help from communities such as this - thanks!
So, I came across the following code that can be used in a vb.net application to validate a credit card number. How would I use this in my application? I was thinking of creating a module, and then calling the module in the LostFocus event of the TextBox holding the string. However, what I couldn't figure out was how to pass the string to the code in the module. In other words, how does the module know to validate the credit card number entered in the TextBox?
Here's the code.
SOURCE: http://www.robin-janssens.com/misc/luhn-...t-generic/
Code: Module LuhnValidate
Private Function ValidLuhn(ByVal Luhn As String) As Boolean
'this function accepts any 16 digit Luhn as long as it is numeric but checks 15 digit ones with the luhn algorithm
Dim ThisDigit As String
Dim Length As Integer
Dim N As Integer
Dim RunningTotal As Integer
If IsNumeric(Luhn) Then
'reverse the Luhn number and find out it's length
Luhn = StrReverse(Luhn)
Length = Len(Luhn)
'process each individual digit
For N = 1 To Length
ThisDigit = Luhn.Substring(N - 1, 1)
'if this number is the 2nd, 4th, 6th etc digit apply some extra processing
If N Mod 2 = 0 Then
'double the digit
ThisDigit *= 2
'if the digit is greater than 9 further processing is needed
If ThisDigit > 9 Then
'add both individual digits up and add them to the running total
ThisDigit = Val(ThisDigit.Substring(0, 1)) + Val(ThisDigit.Substring(1, 1))
RunningTotal += ThisDigit
Else
'otherwise just add the number to the running total
RunningTotal += ThisDigit
End If
Else
'otherwise just add this digit to the running total
RunningTotal += ThisDigit
End If
Next N
'if the resulting number is divisible by 10, the Luhn is correct
If RunningTotal Mod 10 = 0 Then
ValidLuhn = True
End If
End If
End Function
End Module
Also, you should know that when I entered this code in Visual Basic - intellisense underlined the last line "End Module". When I hover over it, this is what is says:
Quote:Function 'ValidLuhn' doesn't return a value on all code paths. Are you missing a 'Return' statement?
Your help would be really appreciated, thanks.
|
|
|
Help Formatting Credit Number in Textbox Control |
Posted by: kismetgerald - 08-24-2012, 09:09 AM - Forum: VB.NET (Visual Basic 2010/2008)
- Replies (11)
|
|
Hey guys,
I am building an in-house application to store all our customer credit card information in a MySQL database. What I want to do is to take user input of the Credit Card number without any formatting (eg., 1111222233334444) and format it based on the Card Type selected by the user.
TASK #1: FORMAT CREDIT CARD NUMBER
I've tried the following to do the first part, but when I debug the formatted number shows up as ####-####-####-#### instead of the number with dashes.
Code: TextBoxCard.Text = Format(TextBoxCard.Text, "#### #### #### ####")
TASK #2: DETECT CARD TYPE
Based on the card number entered, I want the application to auto-select the card type from a read-only combobox. I'm not sure how to go about this. The different types of credit card number formats are listed here: http://www.wysiwyg.co.il/Anatomy-of-Cred...ormats.asp
Your help would be most appreciated, thanks.
|
|
|
Help Online Public Access Catalog |
Posted by: ryunaga63 - 08-20-2012, 08:16 PM - Forum: VB.NET (Visual Basic 2010/2008)
- No Replies
|
|
Hi Brandonio I have seen your videos in youtube I am amazed with your programming skill and also I want to say hi to the rest of the master coders here...
I have problem here if you guys would like to help me how to create a source code on how to add , edit, update , and search in OPAC it is used in Library
I already have my simple log in here and its working but I don't know how to make it Case sensitive on username and password I have the download link here more information about this program
donwload link :
<!-- m --><a class="postlink" href="http://rapidgator.net/file/34577580/LabExer2.pdf.html">http://rapidgator.net/file/34577580/LabExer2.pdf.html</a><!-- m -->
Thanks
Quote:Imports System.Data.OleDb
Public Class LogIn
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim form1 As New Form1
Me.Hide()
form1.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Mycon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Ace\Documents\Admin.mdb")
Dim cmd As OleDbCommand = New OleDbCommand( _
"SELECT * FROM Admin WHERE Username = '" & _
TextBox1.Text & "' AND [Password] = '" & TextBox2.Text & "' ", Mycon)
Mycon.Open()
Dim sdr As OleDbDataReader = cmd.ExecuteReader()
If (sdr.Read() = True) Then
MsgBox("Successfully Login", MsgBoxStyle.Information, "Log In Passed")
Dim mainForm As New Book_Info
mainForm.Show()
Me.Hide()
Else
MsgBox("Invalid username or password!", MsgBoxStyle.RetryCancel, "Log In Failed")
TextBox1.Clear()
TextBox2.Clear()
End If
End Sub
End Class
|
|
|
What is LINQ to SQL? |
Posted by: Moldraxian - 08-20-2012, 05:38 AM - Forum: Programming Help
- No Replies
|
|
I've been doing some research and I've been seeing many things about something called LINQ. It looks like a way to build complicated SQL queries but it is very hard to understand. Does anyone have any tips that would help LINQ make more sense?
I made my own query and I had this error pop up:
Cannot perform 'Like' operation on System.DateTime and System.String.
I don't understand why I get this error but this is my code. Code: Private Sub txtOrder_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtOrder.TextChanged
If txtOrder.TextLength > 0 Then
All_flood_certsBindingSource.Filter = String.Format("[Order Received] Like '" & txtOrder.Text) & "'"
Else
All_flood_certsBindingSource.Filter = String.Empty
End If
End Sub
|
|
|
|