Click here to Skip to main content
15,886,873 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to keep a form always active Pin
Froz3n2-Aug-07 4:35
Froz3n2-Aug-07 4:35 
QuestionWindows forms and message box Pin
rk4ps2-Aug-07 0:25
rk4ps2-Aug-07 0:25 
AnswerRe: Windows forms and message box Pin
eyes20072-Aug-07 0:32
eyes20072-Aug-07 0:32 
GeneralRe: Windows forms and message box Pin
rk4ps2-Aug-07 0:58
rk4ps2-Aug-07 0:58 
GeneralRe: Windows forms and message box Pin
rk4ps2-Aug-07 1:15
rk4ps2-Aug-07 1:15 
AnswerRe: Windows forms and message box Pin
Christian Graus2-Aug-07 0:37
protectorChristian Graus2-Aug-07 0:37 
QuestionIncorporate mutli-language in vb6 application Pin
takaz1231-Aug-07 23:06
takaz1231-Aug-07 23:06 
Questionwhat is wrong with the Following code Pin
Vimalsoft(Pty) Ltd1-Aug-07 23:05
professionalVimalsoft(Pty) Ltd1-Aug-07 23:05 
i have a code that points to one line, i have used my error trap, to trap it and it gave me an Error, that i dont see where it points to,here is the code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=sde;Password=topology;data source=SGIICORNETGS01;persist security info=False;initial catalog=Tshwane_Valuations"
        Dim cn As SqlConnection = New SqlConnection(strconnection)
        cn.Open()
        'set up data adapter 
        Dim strSql As String = _
"select Boundary_Area,Actual_Extent," _
& "Attrib_code,Lis_key,Func_key," _
& "Density,New_Net_Usable_Extent," _
& "New_Total_Land_Factor,New_AdJ_Extent_1," _
& "New_Points_1,New_ADJ_Extent_2," _
& "New_Points_2,Fin_Ls_Prediction," _
& "Confidence_score,Flagtype from Property_Mass"
        Dim strErrorMsg As String
        Dim strerror As System.Data.SqlClient.SqlError
        Try
            Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)
            'Declare and load the Data set
            Dim ds As DataSet = New DataSet
            da.Fill(ds, "Property_Mass")
            'set up data Adapter Object
            strSql = _
    "select Property_Mass.Boundary_Area,Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _
    & "Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor,Property_Mass.New_AdJ_Extent_1,Property_Mass.New_Points_1,Property_Mass.New_ADJ_Extent_2,Property_Mass.New_Points_2,Property_Mass.Fin_Ls_Prediction,Property_Mass.Confidence_score,Property_Mass.Flagtype,Property_Summary.Purchase_Date,Property_Summary.Purchase_Price" _
    & "from(Property_Mass, Property_Summary)" _
    & "where(Property_Mass.Lis_key = Property_Summary.Lis_key)"
            da = New SqlDataAdapter(strSql, cn)
            'load a Dataset 

            da.Fill(ds, "Property_Mass")
            'Close the Connection
            'cn.Close()
            'Create relations 
            ds.Relations.Add("Property_summary_Mass", _
            ds.Tables("Property_Mass").Columns("Lis_key"), _
            ds.Tables("Property_Summary").Columns("Lis_key"))

            'Bind the data set to the grid.
            'Assumes that Grid contains a reference to a 
            'system.windows.datagrid
            DataGrid2.SetDataBinding(ds, "Property_Mass")
            'sorting the Datagrid
            'DataGrid2.AllowSorting = True
        Catch ExSQL As System.Data.SqlClient.SqlException
            '   '''All this will trap all data Problems and Network if available
            For Each strerror In ExSQL.Errors
            Next
            Select Case strerror.Number
                Case 17
                    strErrorMsg = "Missing server"
                Case 4060
                    strErrorMsg = "Missing database"
                Case 18456
                    strErrorMsg = "Missing user name or password"
                Case Else
                    strErrorMsg = strerror.Message
            End Select
            MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)

                Catch ExcpInvOp As System.InvalidOperationException

            MessageBox.Show("Close the connection first!", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error)

        Catch Excp As System.Exception ' generic exception handler

            MessageBox.Show(Excp.Message, "Unexpected Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub



    Private Sub btnliskey_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnliskey.Click

        'Open Database Connection
        Dim strconnection As String = "workstation id=5875-049;packet size=4096; user id=###;  Password=######; data source=########;persist security info=False;initial catalog=Tshwane_Valuations"
        Dim cn As SqlConnection = New SqlConnection(strconnection)
        cn.Open()

        'set up data adapter 
        Dim strSql As String = _
        "select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _
          & "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1,New_Points_1," _
          & "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence,LS_TYPE from Property_Mass "
        Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)

        '       Load(DataSet)
        Dim ds As DataSet = New DataSet
        da.Fill(ds, "Property_Mass")

        'Set up a new Data adapter Object
        strSql = _
        "select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _
         & " Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor,Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _
        & " Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _
        & " Property_Summary.Purchase_Date, Property_Summary.Purchase_Price" _
        & " from Property_Mass, Property_Summary" _
        & "where Substring(Lis_key,1,4) LIKE @Pattern"
        da.SelectCommand.Parameters("Lis_key").Value = txtliskeysearch.Text

        If ds.Tables("Property_Mass").Rows.Count = 0 Then
            MessageBox.Show("Township not Found")
        Else
            da.Fill(ds)
        End If

And this is the Error

The Column Prefix 'Property_Summary' does not match with the table name or Alias name used in this Query.

Thanks you



Vuyiswa Maseko

AnswerRe: what is wrong with the Following code Pin
Tom Deketelaere1-Aug-07 23:34
professionalTom Deketelaere1-Aug-07 23:34 
GeneralRe: what is wrong with the Following code Pin
Vimalsoft(Pty) Ltd2-Aug-07 2:10
professionalVimalsoft(Pty) Ltd2-Aug-07 2:10 
GeneralRe: what is wrong with the Following code Pin
Tom Deketelaere2-Aug-07 2:29
professionalTom Deketelaere2-Aug-07 2:29 
AnswerRe: what is wrong with the Following code Pin
Christian Graus2-Aug-07 0:25
protectorChristian Graus2-Aug-07 0:25 
AnswerRe: what is wrong with the Following code Pin
Paramhans Dubey2-Aug-07 2:26
professionalParamhans Dubey2-Aug-07 2:26 
GeneralRe: what is wrong with the Following code Pin
Vimalsoft(Pty) Ltd2-Aug-07 3:20
professionalVimalsoft(Pty) Ltd2-Aug-07 3:20 
GeneralRe: what is wrong with the Following code Pin
Tom Deketelaere2-Aug-07 4:05
professionalTom Deketelaere2-Aug-07 4:05 
AnswerRe: what is wrong with the Following code Pin
Vimalsoft(Pty) Ltd2-Aug-07 22:21
professionalVimalsoft(Pty) Ltd2-Aug-07 22:21 
QuestionUpdating the database with SqlDataAdapter Pin
HinJinShah1-Aug-07 22:56
HinJinShah1-Aug-07 22:56 
Questionhow can i recognise voice? Pin
Ashraf zia1-Aug-07 21:53
Ashraf zia1-Aug-07 21:53 
AnswerRe: how can i recognise voice? Pin
Christian Graus1-Aug-07 21:56
protectorChristian Graus1-Aug-07 21:56 
Questionsend data from a listbox to textbox Pin
sixecho1-Aug-07 21:41
sixecho1-Aug-07 21:41 
AnswerRe: send data from a listbox to textbox Pin
Christian Graus1-Aug-07 21:49
protectorChristian Graus1-Aug-07 21:49 
AnswerRe: send data from a listbox to textbox Pin
Tom Deketelaere1-Aug-07 23:36
professionalTom Deketelaere1-Aug-07 23:36 
QuestionUsing .NET dll in VB Script Pin
Amma123!!1-Aug-07 20:34
Amma123!!1-Aug-07 20:34 
AnswerRe: Using .NET dll in VB Script Pin
Christian Graus1-Aug-07 20:45
protectorChristian Graus1-Aug-07 20:45 
GeneralRe: Using .NET dll in VB Script Pin
Amma123!!2-Aug-07 5:01
Amma123!!2-Aug-07 5:01 

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.