Reputation: 162 Stalwart
- Active Posts:
- 568 (0.4 per day)
- 03-February 10
- Profile Views:
- Last Active:
- Dec 01 2013 08:36 AM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Dream Kudos:
Posts I've Made
Posted 26 Nov 2013What is your exact error message? Are you sure that all of your arrays have been initialized before you are trying to fill them?
Is this for a class or work? Can you use
File.ReadAllLines()instead of iterating each line in the file?
Just a few questions for clarification.
Posted 22 Nov 2013You should put your cartId assignment after you check for a valid value in the cookie.
Posted 4 Nov 2013This is a very good article that would guide you through creating a class library that you could use to get at the Active Directory content you want. I've used most of this myself.
VB.Net working with Active Directory
Posted 30 Jan 2013Pseudo code it out.
User Input 1. Check for null or empty entry A. Is valid input? a. yes then continue b. no i. Display error message ii. do not continue processing 2. Process Input Process Input 1. Determine Abbr vs Full Name (Length?) A. Abbr = true a. Loop through array of countries (For .. Next?) b. Does it match? i. yes then matchfound = true ii. no then continue loop B. Full name = true a. Loop through array of countries b. Does it match? i. yes then matchfound = true ii. no then continue loop 2. Is matchfound = true? A. Yes a. Display abbr or fullname or both B. No a. Display error message
Once you understand the steps (pseudo code) then you can start applying code.
Pseudo code will also help you to identify parts that can be factored out to separate methods or functions.
Posted 9 Jun 2012To split the string
Dim splitString() As String = naam.Split() 'This gives you an array of values 'splitString(0) = "william" 'splitString(1) = "lemeer"
Using the above code to perform the split you then build your SQL statement. (and since you don't include which provider we'll assume SQL)
Dim splitString() As String = naam.Split() 'This gives you an array of values 'splitString(0) = "william" 'splitString(1) = "lemeer" 'Make the SQL query string Dim queryString = "SELECT personeelnr FROM personeel WHERE personeel.naam =@firstName AND personeel.achternaam = @lastName" 'create our database connection and the command object that we will use Using connection As New SqlConnection(connectionString) Using command As New SqlCommand(queryString, connection) 'check if the connection is open, if not then open it If Not connection.State = ConnectionState.Open Then connection.Open() End If 'Add parameters command.Parameters.AddWithValue("@firstName", splitString())) command.Parameters.AddWithValue("@lastName", splitString(1)) 'Get the reader object Dim reader As SqlDataReader = command.ExecuteReader() 'Fill a table of values Dim dtResults As New DataTable("Results") dtResults.Load(reader) End Using End Using
- Member Title:
- D.I.C Addict
- 40 years old
- February 2, 1973
- my family, reading, programming,
- Full Name:
- Years Programming:
- Programming Languages:
- VB.NET, C#.NET, ASP.NET, SharePoint 2007 development