0

私が持っているのは、たとえば2つのmysqlテーブルです。

Table 1:

----------------
|  ID |  Time  |
****************
| 1  | 3:00pm  | 
----------------    
| 2  | 4:00pm  | 
----------------
| 3  | 5:00pm  | 
----------------
| 4  | 6:00pm  |
 ---------------
| 5   7:00pm   |    
================ 

Table 2:
----------------
|  ID  |  Type |
****************
|  1   |   A   |
----------------    
|  2   |   B   | 
----------------
|  3   |   C   | 
----------------
|  4   |   D   |
----------------
|  5   |   E   |    
================ 

基本的に達成したいのは、ASP.NETにフォームを作成して、カテゴリA,B,C,D,Eを列として上部に表示し、左側に各セルのテキストボックスを表示して、値を配置してから別のテーブルを更新できるようにすることです。割り当てをマップします。EGカテゴリーAは午後3時などに5つあります。

これは可能ですか?また、カテゴリや時間は異なる場合があるため、selectステートメントから取得した値に基づいてテーブルを作成する必要があります。

編集

私が何を意味するかを示すためにExcelでクイックハッシュアップするので、基本的にはmySQLから取得したものに基づいて行と列を作成します。次に、各セルのテキストボックスに入力し、[更新]ボタンをクリックして、割り当て用に用意した別のテーブルに値を保存します。

img1

4

1 に答える 1

0

You would probably need to have an ID which is the primary key and then another set of ID for each table that will be a foreign key for this to work. So for example, ID > primary key, TypeID(for type table) > foreign key relates to time, and TimeID(for time table) > foreign key relates to type. That's really the only way i see you combining the tables for the update. Now for putting this in a gridview, might be another issue. For that i'd refer you to this:How to merge two tables

于 2013-05-26T05:04:00.983 に答える