本文整理汇总了C#中System.Data.Odbc.OdbcDataReader.GetDate方法的典型用法代码示例。如果您正苦于以下问题:C# OdbcDataReader.GetDate方法的具体用法?C# OdbcDataReader.GetDate怎么用?C# OdbcDataReader.GetDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Odbc.OdbcDataReader
的用法示例。
在下文中一共展示了OdbcDataReader.GetDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateForm
public static bool CreateForm(OdbcDataReader reader, Teacher teacher)
{
int fCount = reader.FieldCount;
for (int i = 0; i < fCount; i++)
{
string name = reader.GetName(i);
// Map to DB field. Need to change if db changed
switch (name) {
case "teacher_id": teacher._teacherID = reader.GetInt32(i);
break;
case "sex": teacher._sex = reader.GetString(i);
break;
case "addr": teacher._addr = reader.GetString(i);
break;
case "tel": teacher._tel = reader.GetString(i);
break;
case "email": teacher._email = reader.GetString(i);
break;
case "birthday":
teacher._birthday = new DateTime(reader.GetDate(i).Ticks);
break;
case "firstname": teacher._firstname = reader.GetString(i);
break;
case "surname": teacher._surname = reader.GetString(i);
break;
case "citizen_id": teacher._citizenID = reader.GetString(i);
break;
case "image": teacher._img = reader.GetString(i);
break;
case "subject": teacher._subject = reader.GetString(i);
break;
case "is_active": teacher._isActive = reader.GetInt32(i) > 0 ? true : false;
break;
}
}
return reader.HasRows;
}
示例2: CreateForm
public static bool CreateForm(OdbcDataReader reader, Payment payment)
{
int fCount = reader.FieldCount;
for (int i = 0; i < fCount; i++)
{
string name = reader.GetName(i);
// Map to DB field. Need to change if db changed
switch (name) {
case "course_id": payment._courseID = reader.GetInt32(i);
break;
case "sum_all_cost": payment._sumAllCost = reader.GetInt32(i);
break;
case "sum_max_payable": payment._sumMaxPayable = reader.GetInt32(i);
break;
case "sum_paid_cost": payment._sumPaidCost = reader.GetInt32(i);
break;
case "last_paid_date": payment._lastPaidDate = new DateTime(reader.GetDate(i).Ticks);
break;
case "paid_round": payment._paidRound = reader.GetInt32(i);
break;
case "status": payment._status = reader.GetInt32(i);
break;
// helper info
case "bts_course_id": payment._btsCourseID = reader.GetString(i);
break;
case "course_name": payment._courseName = reader.GetString(i);
break;
case "course_start_date": payment._courseStartDate = new DateTime(reader.GetDate(i).Ticks);
break;
case "course_end_date": payment._courseEndDate = new DateTime(reader.GetDate(i).Ticks);
break;
case "paid_group_id": payment._paidGroupID = reader.GetInt32(i);
break;
}
}
return reader.HasRows;
}
示例3: CreateForm
public static bool CreateForm(OdbcDataReader reader, Course course)
{
if (course._teacher == null) { course._teacher = new Teacher(); }
if (course._paidGroup == null) { course._paidGroup = new PaidGroup(); }
int fCount = reader.FieldCount;
for (int i = 0; i < fCount; i++)
{
string name = reader.GetName(i);
// Map to DB field. Need to change if db changed
switch (name) {
case "course_id": course._courseID = reader.GetInt32(i);
break;
case "bts_course_id": course._btsCourseID = reader.GetString(i);
break;
case "course_name": course._courseName = reader.GetString(i);
break;
case "short_name": course._shortName = reader.GetString(i);
break;
case "course_desc": course._courseDesc = reader.GetString(i);
break;
case "course_type": course._courseType = reader.GetString(i);
break;
case "room_id": course._roomID = reader.GetInt32(i);
break;
case "teacher_id": course._teacherID = reader.GetInt32(i);
course._teacher._teacherID = course._teacherID;
break;
case "paid_group_id": course._paidGroupID = reader.GetInt32(i);
course._paidGroup._paidGroupID = course._paidGroupID;
break;
case "category": course._category = reader.GetString(i);
break;
case "start_date": course._startdate = new DateTime(reader.GetDate(i).Ticks);
break;
case "end_date": course._enddate = new DateTime(reader.GetDate(i).Ticks);
break;
case "day_of_week": course._dayOfWeek = reader.GetString(i);
break;
case "open_time": course._opentime = reader.GetString(i);
break;
case "cost": course._cost = reader.GetInt32(i);
course._discountedCost = course._cost;
break;
case "seat_limit": course._seatLimit = reader.GetInt32(i);
break;
case "bank_regis_limit": course._bankRegisLimit = reader.GetInt32(i);
break;
case "image": course._img = reader.GetString(i);
break;
case "is_active": course._isActive = reader.GetInt32(i) > 0 ? true : false;
break;
// helper info
case "teacher_firstname":
course._teacher._firstname = reader.GetString(i);
break;
case "teacher_surname":
course._teacher._surname = reader.GetString(i);
break;
case "num_registered":
course._numRegistered = reader.GetInt32(i);
break;
}
}
return reader.HasRows;
}