Click here to Skip to main content
15,909,051 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Compare the structure for 2 sql server databases Pin
Eddy Vluggen10-Apr-15 8:36
professionalEddy Vluggen10-Apr-15 8:36 
GeneralRe: Compare the structure for 2 sql server databases Pin
dilkonika10-Apr-15 9:36
dilkonika10-Apr-15 9:36 
GeneralRe: Compare the structure for 2 sql server databases Pin
Eddy Vluggen10-Apr-15 10:10
professionalEddy Vluggen10-Apr-15 10:10 
GeneralRe: Compare the structure for 2 sql server databases Pin
dilkonika10-Apr-15 10:16
dilkonika10-Apr-15 10:16 
GeneralRe: Compare the structure for 2 sql server databases Pin
Eddy Vluggen10-Apr-15 10:27
professionalEddy Vluggen10-Apr-15 10:27 
GeneralRe: Compare the structure for 2 sql server databases Pin
dilkonika10-Apr-15 12:35
dilkonika10-Apr-15 12:35 
GeneralRe: Compare the structure for 2 sql server databases Pin
Eddy Vluggen11-Apr-15 8:49
professionalEddy Vluggen11-Apr-15 8:49 
Questionvb.net 2010 pass value to function Pin
dcof9-Apr-15 13:04
dcof9-Apr-15 13:04 
In a vb.net 2010 application, I want to make a minor change to an existing application. I want to pass the value of 'SchoolNum' into the sql listed below but I am getting an error message. I do not know what the error message is since the object is not accessible

The following is the code of where the call is coming from:

Letter is an object that is passed between different parts of the application.

Dim SchoolNum As String = '332'

_dtDetail = SelectDetail(Letter, SchoolNum)

The following is the function that is executed.
"Public Function SelectDetail(ByVal Letter As Letter, ByVal SchoolNum As String) As DataTable"
     Public Function SelectDetail(ByVal Letter As Letter, ByVal SchoolNum As String) As DataTable
        Dim _dt As DataTable = New DataTable()
        Dim SchoolNumber As String = SchoolNum
  Const sql As String = "SELECT d.LINK,d.absdt  " _
                            & ",CAST(ROUND(SUM([ABSCNT]), 2) AS NUMERIC(24,2)) AS absentCount " _                             & "FROM ADetails d INNER JOIN AASTU s ON d.link = s.link  " _
                            & "INNER JOIN AASCH sch ON d.schoolnum = sch.schoolnum  " _
                            & "WHERE d.STULINK = @link " _
                            & "AND d.schoolnum =   + SchoolNum " _
                            & "GROUP BY d.LINK,d.absdt  " _
                            & "ORDER BY d.ABSDT ; "

       Using con As SqlConnection = DB.OpenConnectionS()
            Using da As SqlDataAdapter = New SqlDataAdapter(sql, con)

               Try
                    da.SelectCommand.Parameters.Add("@link", SqlDbType.Int).Value = Letter.Link
                    da.Fill(_dt)
                Catch ex As Exception

               End Try

           End Using
        End Using

       Return _dt
    End Function
   #End Region

Thus can you show me the code where I can pass in a string value called SchoolNum into the function called 'SelectDetail' so the sql will execute successfully?
AnswerRe: vb.net 2010 pass value to function Pin
Richard MacCutchan9-Apr-15 21:53
mveRichard MacCutchan9-Apr-15 21:53 
AnswerRe: vb.net 2010 pass value to function Pin
Richard Deeming10-Apr-15 3:39
mveRichard Deeming10-Apr-15 3:39 
GeneralRe: vb.net 2010 pass value to function Pin
dcof10-Apr-15 4:12
dcof10-Apr-15 4:12 
QuestionVB6 TextBox truncates text in IE 11 Compatibility Mode Pin
Bill Cumming9-Apr-15 5:29
Bill Cumming9-Apr-15 5:29 
QuestionRe: VB6 TextBox truncates text in IE 11 Compatibility Mode Pin
Richard Deeming9-Apr-15 7:08
mveRichard Deeming9-Apr-15 7:08 
AnswerRe: VB6 TextBox truncates text in IE 11 Compatibility Mode Pin
Bill Cumming9-Apr-15 7:15
Bill Cumming9-Apr-15 7:15 
QuestionWM that has to do with pressing the enter key and TAB key. Pin
dilkonika8-Apr-15 13:29
dilkonika8-Apr-15 13:29 
AnswerRe: WM that has to do with pressing the enter key and TAB key. Pin
CHill608-Apr-15 13:44
mveCHill608-Apr-15 13:44 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
dilkonika8-Apr-15 13:48
dilkonika8-Apr-15 13:48 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
CHill608-Apr-15 13:58
mveCHill608-Apr-15 13:58 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
dilkonika8-Apr-15 15:35
dilkonika8-Apr-15 15:35 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
CHill608-Apr-15 23:41
mveCHill608-Apr-15 23:41 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
dilkonika9-Apr-15 6:34
dilkonika9-Apr-15 6:34 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
dilkonika9-Apr-15 7:21
dilkonika9-Apr-15 7:21 
GeneralRe: WM that has to do with pressing the enter key and TAB key. Pin
CHill609-Apr-15 10:49
mveCHill609-Apr-15 10:49 
QuestionSelectedPath Property Pin
JKarov7-Apr-15 4:39
JKarov7-Apr-15 4:39 
AnswerRe: SelectedPath Property Pin
Richard Andrew x647-Apr-15 5:12
professionalRichard Andrew x647-Apr-15 5:12 

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.