Click here to Skip to main content
16,006,341 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
CHill6028-May-16 3:19
mveCHill6028-May-16 3:19 
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
Dave Kreskowiak28-May-16 3:30
mveDave Kreskowiak28-May-16 3:30 
GeneralRe: Aliasing Fieldnames and adding a calculation Field Pin
Raabi Anony29-May-16 17:11
Raabi Anony29-May-16 17:11 
QuestionExcel view to datagridview migration Pin
Member 476123426-May-16 20:37
Member 476123426-May-16 20:37 
AnswerRe: Excel view to datagridview migration Pin
Richard MacCutchan26-May-16 21:18
mveRichard MacCutchan26-May-16 21:18 
GeneralRe: Excel view to datagridview migration Pin
Member 476123426-May-16 22:19
Member 476123426-May-16 22:19 
GeneralRe: Excel view to datagridview migration Pin
Member 476123426-May-16 22:19
Member 476123426-May-16 22:19 
GeneralRe: Excel view to datagridview migration Pin
Richard MacCutchan26-May-16 22:52
mveRichard MacCutchan26-May-16 22:52 
QuestionWHERE clause of SELECT command Pin
Raabi Anony25-May-16 21:11
Raabi Anony25-May-16 21:11 
AnswerRe: WHERE clause of SELECT command Pin
Raabi Anony25-May-16 21:19
Raabi Anony25-May-16 21:19 
GeneralRe: WHERE clause of SELECT command Pin
Richard Deeming26-May-16 2:03
mveRichard Deeming26-May-16 2:03 
QuestionHow to populate data in combobox gridview in VB.net? Pin
kishore-201625-May-16 11:32
kishore-201625-May-16 11:32 
AnswerRe: How to populate data in combobox gridview in VB.net? Pin
Richard MacCutchan25-May-16 21:03
mveRichard MacCutchan25-May-16 21:03 
GeneralRe: How to populate data in combobox gridview in VB.net? Pin
kishore-20165-Jun-16 10:20
kishore-20165-Jun-16 10:20 
GeneralRe: How to populate data in combobox gridview in VB.net? Pin
Richard MacCutchan5-Jun-16 21:24
mveRichard MacCutchan5-Jun-16 21:24 
QuestionDGV with multiple Tables Pin
Raabi Anony23-May-16 17:41
Raabi Anony23-May-16 17:41 
AnswerRe: DGV with multiple Tables Pin
Mycroft Holmes23-May-16 19:53
professionalMycroft Holmes23-May-16 19:53 
SuggestionRe: DGV with multiple Tables Pin
Richard Deeming24-May-16 1:34
mveRichard Deeming24-May-16 1:34 
GeneralRe: DGV with multiple Tables Pin
Mycroft Holmes24-May-16 12:38
professionalMycroft Holmes24-May-16 12:38 
AnswerRe: DGV with multiple Tables Pin
Richard Deeming24-May-16 1:41
mveRichard Deeming24-May-16 1:41 
GeneralRe: DGV with multiple Tables Pin
Raabi Anony24-May-16 16:06
Raabi Anony24-May-16 16:06 
GeneralRe: DGV with multiple Tables Pin
Raabi Anony25-May-16 0:41
Raabi Anony25-May-16 0:41 
Sorry for another show up with hope.
I am still stuck with the
VB
Dim conxnString As String = My.MySettings.sqlConnectionString

Or
VB
Dim conxnString As String = My.Settings.sqlConnectionString

VisualStudio 2015 says "sqlConnectionString is not a member of MySettings"
Do I need to Import some Library, other than System.Data.SqlClient ?
My whole code is as below:
VB
Private Function cboCampuses_SelectedValueChanged(sender As Object, e As EventArgs) Handles cboCampuses.SelectedValueChanged
       Dim selectedValue As String
       selectedValue = cboCampuses.SelectedValue
       Me.StaffEvaluationDGV.DataSource = GetDataSource(selectedValue)
   End Function

   Private Function GetDataSource(selectedValue) As DataTable
       Dim sqlSelect As String = "SELECT * FROM tblEvaln " &
          "WHERE CampusName = " & selectedValue

       Dim SqlConnection As SqlConnection
       Dim conxnString As String = My.MySettings.sqlConnectionString
       Try
           Dim table = New DataTable()
           Using con = New System.Data.SqlClient.SqlConnection(conxnString)
               con.Open()
               Using da = New System.Data.SqlClient.SqlDataAdapter(sqlSelect, con)
                   da.Fill(table)
                   Return table
               End Using
           End Using
       Catch ex As Exception
           ' Error message here
       End Try
   End Function

Would anybody help me please!
GeneralRe: DGV with multiple Tables Pin
Richard Deeming25-May-16 0:55
mveRichard Deeming25-May-16 0:55 
QuestionString or Binary Data Would be Truncated. The Statement has been Terminated Pin
kishore-201622-May-16 7:35
kishore-201622-May-16 7:35 
AnswerRe: String or Binary Data Would be Truncated. The Statement has been Terminated Pin
Sascha Lefèvre22-May-16 12:19
professionalSascha Lefèvre22-May-16 12:19 

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.