asp.net - SQL syntax, and c# table entry into database -


I have two problems

  1. data from mySQL snytax
  2. Insert ASP Table 1 control

    I have two table users (with user ID = 1 (auto-increment)) and walloposts which are field walloposting (one for two as a capital P Not to confuse)

    I would like to join one so that the walls will know which user has to refresh it And then insert data from my Table 1 control

    Tables:

      ------------------ User- --------------- UserID (PK, AI) Name DOB Location etc. ---------------- Volposting ----- -------------- UserID (PK) Valposting   

    There is a connection to the tables

      OdbcCommand cmd = New OdbcCommand (Insert "WallPostings (Wallpostings)" values ​​('+ 1 Table +' '' ', cn); OdbcDataReader Reader = CMD.x Reader ();   

    How to Be sure to join Is the same userid set in the user's table similar to the WallPosting table?

    If you do not have it already, you should have user ID in the user's volume so that user The foreign key of the table is that it does not allow userID that does not exist there instructional integrity.

    Then you do not need to be included in your code, you should know what the User ID is when the wall posting is inserted. Then you have: Insert in Valpostings (User ID, Volposting) values ​​(1, 'data goes here')

    Assume that users Has been entered in some fashion sites so you can know that their user ID is when this data is modified or made.

Comments