Click here to Skip to main content
15,900,108 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 0:10
Colin Angus Mackay20-Sep-07 0:10 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 1:49
professionalVimalsoft(Pty) Ltd20-Sep-07 1:49 
GeneralRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 2:33
Colin Angus Mackay20-Sep-07 2:33 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 2:50
professionalVimalsoft(Pty) Ltd20-Sep-07 2:50 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 3:55
professionalVimalsoft(Pty) Ltd20-Sep-07 3:55 
GeneralRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 4:23
Colin Angus Mackay20-Sep-07 4:23 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 5:28
professionalVimalsoft(Pty) Ltd20-Sep-07 5:28 
GeneralRe: DAll And BLL Template Question Pin
Dave Kreskowiak20-Sep-07 4:33
mveDave Kreskowiak20-Sep-07 4:33 
Vuyiswamb wrote:
i had a problem with the Connection string

DIm connectionString as String = ConfigurationManager.AppSettings["ConnectionString"]

The IDE tells me that "Identifier Expected"
The First one is the namespaces that needs to be imported


This needs it's namespace imported at the top of the code.
Imports System.Configuration



Vuyiswamb wrote:
using System.Collections.Generic;

This line it does not recognise the Generic. if i remove it "Generic" it does not Complain.


What version of VB.NET are you using? 2003, 2005, ??? Generics only exist in 2005 (.NET 2.0) and above.


Vuyiswamb wrote:
The Second Function i coverted it like this

Should be this instead:
Private Function BuildCommand(ByVal storedProcedureName As String)
    ' Create a connection to the database.
    Dim connection As New SqlConnection(connectionString)
    ' Create the command object - The named stored procedure
    ' will be called when needed.
    Dim result As New SqlCommand(storedProcedureName, connection)
    result.CommandType = CommandType.StoredProcedure
    Return result
End Function



Vuyiswamb wrote:
My Following Function is like this


Should be this becuase BuildCommand already returns an SqlCommand object:
' Builds a DataAdapter that can be used for retrieving the
' results of queries
Private Function BuildBasicQuery(ByVal storedProcedureName As String)
    Dim cmd As SqlCommand = BuildCommand(storedProcedureName)
    ' Set up the data adapter to use the command already setup.
    Dim result As New SqlDataAdapter(cmd)
    Return result
End Function



That's enough for now. Guy, the very simple mistakes you put into your version of the code have nothing to do with converting it from C# to VB.NET. They stem more from not understanding the VB.NET you're writing. You're converting the code visually, but you're not understanding the concepts that code is illustrating.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: DAll And BLL Template Question Pin
Dave Kreskowiak20-Sep-07 4:48
mveDave Kreskowiak20-Sep-07 4:48 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 5:20
professionalVimalsoft(Pty) Ltd20-Sep-07 5:20 
QuestionRunning two projects as one application Pin
saaaas19-Sep-07 17:52
saaaas19-Sep-07 17:52 
AnswerRe: Running two projects as one application Pin
Christian Graus19-Sep-07 18:19
protectorChristian Graus19-Sep-07 18:19 
QuestionExcel - How to read data from an XML file... Pin
Albert Giraudi19-Sep-07 16:37
Albert Giraudi19-Sep-07 16:37 
AnswerRe: Excel - How to read data from an XML file... Pin
Gary Bigman19-Sep-07 21:16
Gary Bigman19-Sep-07 21:16 
GeneralRe: Excel - How to read data from an XML file... Pin
Albert Giraudi20-Sep-07 16:13
Albert Giraudi20-Sep-07 16:13 
QuestionForm Load Pin
Jodd19-Sep-07 14:04
Jodd19-Sep-07 14:04 
AnswerRe: Form Load Pin
Luc Pattyn19-Sep-07 15:42
sitebuilderLuc Pattyn19-Sep-07 15:42 
GeneralRe: Form Load Pin
Jodd19-Sep-07 22:51
Jodd19-Sep-07 22:51 
AnswerRe: Form Load Pin
helelark12319-Sep-07 20:21
helelark12319-Sep-07 20:21 
AnswerRe: Form Load Pin
Tom Deketelaere19-Sep-07 20:43
professionalTom Deketelaere19-Sep-07 20:43 
GeneralRe: Form Load Pin
Jodd19-Sep-07 22:52
Jodd19-Sep-07 22:52 
QuestionVB 6 and VB.net 2003 Network objects Pin
Phill_Goin19-Sep-07 12:27
Phill_Goin19-Sep-07 12:27 
AnswerRe: VB 6 and VB.net 2003 Network objects Pin
Gary Bigman19-Sep-07 22:14
Gary Bigman19-Sep-07 22:14 
GeneralRe: VB 6 and VB.net 2003 Network objects Pin
Phill_Goin20-Sep-07 2:30
Phill_Goin20-Sep-07 2:30 
GeneralRe: VB 6 and VB.net 2003 Network objects Pin
Dave Kreskowiak20-Sep-07 4:06
mveDave Kreskowiak20-Sep-07 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.