none
Will SHAPE APPEND RELATE work with A Dataset in vb.net 2019? RRS feed

  • Question

  • this is the sample

    Dim StringSql as string

    the Sql String is: StringSql="SHAPE {select * from t1} APPEND ({select * from t2} RELATE k1 TO k2)"

     the Dataset Sample is:

    Dim ADLoltr As New OleDbDataAdapter
        Dim DSltr As New DataSet
        Dim ADLltr As New SqlClient.SqlDataAdapter

     Using SqlxCConct As New SqlConnection(SQLConetion)
                            SqlxCConct.Open()
                            ADLltr.SelectCommand = New SqlCommand(StringSql, SqlxCConct)
                            ADLltr.Fill(DSltr)
                        End Using

    TextBox3.Text = DSltr.Tables("t1").Rows(0).Item("type").ToString() 

    TextBox4.Text = DSltr.Tables("t2").Rows(i).Item("shape").ToString()

    Will This Work?



    Thursday, September 5, 2019 9:13 PM

All replies

  • Hello,

    Data shaping is for working with ADO recordsets. Perhaps you can explain what you what to achieve for a modern solution. 

    Lastly, "will SHAPE APPEND RELATE work with A Dataset in vb.net 2019?", one way to figure this out is to try it.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, September 5, 2019 10:56 PM
    Moderator
  • Hi,

    SHAPE and APPEND are not valid T-SQL key words,They are used in ADO.

    The "select * from t1" after shape is the first SQL query statement, which is responsible for finding the attribute values of the parent node in the returned xml. The "select * from t2" after append is the second SQL statement, which is used to find the attribute values of the child node after the parent node is attached. The connection between the two SQL statements is the subsequent related K1 to k2. K1 is a field name queried in the first statement, that is, a field name of * in the first sql. Similarly, K2 is a field of * in the second SQL statement. Their relationship is K1 = k2.

    Here's an article on how to use them:

    https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/shape-append-clause

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 6, 2019 8:13 AM
    Moderator
  • i tesed and i got an error

      Message=Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

    is it any way how to use 

    SHAPE APPEND RELATE

    in a dataset?


    Friday, September 6, 2019 2:44 PM
  • Hi,

    This is an example from MSDN, but it is written using VB code. You can have a look at it.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 9, 2019 7:07 AM
    Moderator