Build DataTable for DataSet

DataSet dsonline = new DataSet();
                DataTable dtonline = new DataTable();
                dtonline.Columns.Add("GameCompany", typeof(string));
                dtonline.Columns.Add("GameType", typeof(string));
                dtonline.Columns.Add("LoginName", typeof(string));
                dtonline.Columns.Add("LoginPassword", typeof(string));
                DataRow dronline = dtonline.NewRow();
                dronline[0] = onlinestoragemodel.GameCompany;
                dronline[1] = onlinestoragemodel.GameType;
                dronline[2] = onlinestoragemodel.LoginName;
                dronline[3] = onlinestoragemodel.LoginPassword;
                dtonline.Rows.Add(dronline);
                dsonline.Tables.Add(dtonline);
                CreateOrderFormOnline(true, dsonline);
posted @ 2008-01-20 13:54  拒绝潜水的鱼  阅读(169)  评论(0编辑  收藏  举报