0

i have a problem. I have database with a tableadpater. i want to get the userid with this tableadapter.

 Dim dsGN As New ForumTableAdapters.Message2TableAdapter

    Dim dtBetrieb As Data.DataTable = dsGN.GetUserIdFromThisMessage(ConversationID)

    For Each objRow As dsGN.Message2Row In dtBetrieb.Rows

        mystring = objRow.UserId.ToString
    Next

i get the error "dsGN.Message2Row is not defined"

The Name ob my table in the database is "Message" i hope that somebody can help me.

4

1 回答 1

0

你必须这样做:

GridView.DataSource = yourAdapter.GetUserID(ID);
GridView.DataBind();

然后创建一个名为:GetUserID 的 tableadapter,您可以在其中从传递 ID 的表中选择:@ID;

希望这有帮助!您可以在此处阅读有关此内容的更多信息:

http://msdn.microsoft.com/en-us/library/aa581776.aspx

于 2011-05-17T12:50:39.780 回答