当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteDataReader.GetString方法代码示例

本文整理汇总了C#中System.Data.SQLite.SQLiteDataReader.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteDataReader.GetString方法的具体用法?C# SQLiteDataReader.GetString怎么用?C# SQLiteDataReader.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SQLite.SQLiteDataReader的用法示例。


在下文中一共展示了SQLiteDataReader.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildUserStructure

 private Person BuildUserStructure(SQLiteDataReader reader)
 {
     string name = reader.GetString(0);
     string fullName = reader.GetString(1);
     long personId = reader.GetInt64(2);
     return new Person(name, fullName, personId);
 }
开发者ID:wtain,项目名称:FinCalc,代码行数:7,代码来源:UsersManager.cs

示例2: ActivityExtractor

 /* Returns a Activity using a SQLiteDataReader and a dictionary mapping the attributes to a index.
  */
 private Activity ActivityExtractor(SQLiteDataReader reader, Dictionary<string, int> attributeIndexDict)
 {
     return new Activity(reader.GetInt32(attributeIndexDict["activityId"]),
             reader.GetInt32(attributeIndexDict["seqNum"]), reader.GetString(attributeIndexDict["workoutName"]),
             reader.GetInt32(attributeIndexDict["numSets"]), reader.GetInt32(attributeIndexDict["workoutVersion"]),
             reader.GetString(attributeIndexDict["exerciseName"]), reader.GetInt32(attributeIndexDict["exerciseVersion"]));
 }
开发者ID:danilind,项目名称:workoutlogger,代码行数:9,代码来源:DatabaseOperations.cs

示例3: BuildStructure

 private Expense BuildStructure(SQLiteDataReader reader)
 {
     long expenseId = reader.GetInt64(0);
     long accountId = reader.GetInt64(1);
     long amount = reader.GetInt64(2);
     long categoryId = reader.GetInt64(3);
     DateTime date = DateTime.Parse(reader.GetString(4));
     string description = reader.GetString(5);
     return new Expense(expenseId, accountId, amount, categoryId, date, description);
 }
开发者ID:wtain,项目名称:FinCalc,代码行数:10,代码来源:ExpensesManager.cs

示例4: ReadTranslationMemory

 private TranslationMemory ReadTranslationMemory(SQLiteDataReader reader)
 {
     TranslationMemory tm = new TranslationMemory();
     tm.tmid = reader.GetInt32(0); // tmid used for update
     tm.japanese = GetSegmentFromXml(reader.GetString(4)); // source_segment
     tm.chinese = GetSegmentFromXml(reader.GetString(6)); // target_segment
     tm.tags += reader.GetString(8) + Environment.NewLine; // user
     tm.tags += reader.GetString(9) + Environment.NewLine; // date
     tm.tmname = Path.GetFileName(this.sourcePath);
     return tm;
 }
开发者ID:chenchenick,项目名称:RESTJsonPlayer,代码行数:11,代码来源:TranslationMemorySqliteParser.cs

示例5: HydrateGuests

 private Guest[] HydrateGuests(SQLiteDataReader reader) {
     var guests = new List<Guest>();
     while (reader.Read()) {
         var guest = new Guest();
         guest.Name = reader.GetString(1);
         guest.ReservationDate = DateTime.Parse(reader.GetString(2));
         guest.Attending = bool.Parse(reader.GetString(3));
         guest.Underage = bool.Parse(reader.GetString(4));
         guests.Add(guest);
     }
     return guests.ToArray();
 }
开发者ID:jdaigle,项目名称:stephanieandjoseph.net,代码行数:12,代码来源:ReservationsController.cs

示例6: printToConsole

        public string printToConsole(SQLiteDataReader readerDB, int index)
        {
            if (readerDB.IsDBNull(index))
            {
                //return "NULL";
                return "";
            }
            else
            {
                String dataObject = readerDB.GetFieldType(index).ToString();
                switch (dataObject)
                {
                    case "System.Int32":
                        return readerDB.GetInt32(index).ToString();
                    case "System.DateTime":
                        DateTime date = readerDB.GetDateTime(index);
                        return Convert.ToString(date);
                    case "System.String":
                        return readerDB.GetString(index);
                    default:
                        return "Unknown";
                }
            }

        }
开发者ID:bootresha,项目名称:EroDatabase,代码行数:25,代码来源:EroDatabaseAdapter.cs

示例7: ReadDvbData

 protected void ReadDvbData(SQLiteDataReader r, IDictionary<string, int> field, DataRoot dataRoot, 
   IDictionary<string, bool> encryptionInfo)
 {
   string longName, shortName;
   this.GetChannelNames(r.GetString(field["channel_label"]), out longName, out shortName);
   this.Name = longName;
   this.ShortName = shortName;
   this.RecordOrder = r.GetInt32(field["channel_order"]);
   this.FreqInMhz = (decimal)r.GetInt32(field["frequency"]) / 1000;
   int serviceType = r.GetInt32(field["dvb_service_type"]);
   this.ServiceType = serviceType;
   this.OriginalNetworkId = r.GetInt32(field["onid"]);
   this.TransportStreamId = r.GetInt32(field["tsid"]);
   this.ServiceId = r.GetInt32(field["sid"]);
   int bits = r.GetInt32(field["list_bits"]);
   this.Favorites = this.ParseFavorites(bits);
   if ((this.SignalSource & SignalSource.Sat) != 0)
   {
     int satId = r.GetInt32(field["sat_id"]);
     var sat = dataRoot.Satellites.TryGet(satId);
     if (sat != null)
     {
       this.Satellite = sat.Name;
       this.SatPosition = sat.OrbitalPosition;
       int tpId = satId * 1000000 + (int)this.FreqInMhz;
       var tp = dataRoot.Transponder.TryGet(tpId);
       if (tp != null)
       {
         this.SymbolRate = tp.SymbolRate;
       }
     }
   }
   this.Encrypted = encryptionInfo.TryGet(this.Uid);      
 }
开发者ID:CIHANGIRCAN,项目名称:ChanSort,代码行数:34,代码来源:DbChannel.cs

示例8: JsonRow

        public JsonRow(SQLiteDataReader result)
        {
            rowData = new JObject();

            for (int i = 0; i < result.FieldCount; i++)
            {
                string column = result.GetString(i);
                rowData[column] = result[i].ToString();
            }
        }
开发者ID:tylorhl,项目名称:NetworkManager,代码行数:10,代码来源:JsonRow.cs

示例9: MapDataReaderToContentDto

        internal static void MapDataReaderToContentDto(SQLiteDataReader dataReader, out ContentDto contentDto)
        {
            contentDto = new ContentDto();

            contentDto.ContentId = dataReader.GetInt64((int) ContentDao.ContentsField.ContentId);
            contentDto.UrlId = dataReader.GetInt64((int) ContentDao.ContentsField.UrlId);
            contentDto.ContentType = (ContentTypesEnum) dataReader.GetInt64((int) ContentDao.ContentsField.ContentType);
            contentDto.Element = dataReader.GetString((int) ContentDao.ContentsField.Element);
            contentDto.Element = HttpUtility.UrlDecode(contentDto.Element);
            contentDto.Line = dataReader.GetInt64((int) ContentDao.ContentsField.Line);
            contentDto.LinePosition = dataReader.GetInt64((int) ContentDao.ContentsField.LinePosition);
        }
开发者ID:jordimas,项目名称:SEOConsuasor,代码行数:12,代码来源:ContentDao.cs

示例10: execute

        public void execute(ref ObservableCollection<TagedItem> _TagedItemCollection)
        {
            sqliteCon.Open();
            createCommand = new SQLiteCommand(query, sqliteCon);
            createCommand.ExecuteNonQuery();
            dataReader = createCommand.ExecuteReader();

            _TagedItemCollection.Clear();

            while (dataReader.Read())
            {
                _TagedItemCollection.Add(new TagedItem
                {
                    FileName = dataReader.GetString(2),
                    FileExension = dataReader.GetString(3),
                    ModifyDate = dataReader.GetString(4)
                });

            }

            sqliteCon.Close();
        }
开发者ID:Choi-Insu,项目名称:arrengers,代码行数:22,代码来源:DBManger.cs

示例11: getLatestMsgFromUser

        public string[] getLatestMsgFromUser(string uid)
        {
            this.clearCmd();
            string username = this.getUsernameById(Convert.ToInt16(uid));
            string[] msgAr = new string[3];
            msgAr[0] = username;

            cmd.CommandText="Select msg,sendTimestamp from msgLog where userid="+uid+" ORDER BY sendTimestamp DESC LIMIT 0,1";

            reader=cmd.ExecuteReader();
            reader.Read();
            msgAr[1] = Convert.ToString(reader.GetDateTime(1));
            msgAr[2] = reader.GetString(0);
            return msgAr;
        }
开发者ID:bluedaw,项目名称:C-Sharp-Chat-Programm,代码行数:15,代码来源:ServerDB.cs

示例12: Button1_Click

    protected void Button1_Click(object sender, EventArgs e)
    {
        con = new SQLiteConnection("Data Source=e:\\db\\project.s3db");
        con.Open();
        SQLiteCommand command = new SQLiteCommand("Select * from train", con);
        reader = command.ExecuteReader();

        //SQLiteDataAdapter ad=new SQLiteDataAdapter(,con);

        //GridView gv = new GridView();
        String str = "<table><tr><th>train no</th><th>train name</th><th>train timing</th><th>avaliable tickets</th><th>total tickets</th><th>cost</th></tr>";
        while (reader.Read())
        {
            str += "</tr><td>" + reader.GetValue(0) + "</td>";
            str += "<td>" + reader.GetString(1) + "</td>";
            str += "<td>" + reader.GetString(2) + "</td>";
            str += "<td>" + reader.GetValue(3) + "</td>";
            str += "<td>" + reader.GetValue(4) + "</td>";
            str += "<td>" + reader.GetValue(5) + "</td></tr>";
        }
        str += "</table>";
        traindiv.InnerHtml = str;
        con.Close();
    }
开发者ID:smuralireddy,项目名称:netproject,代码行数:24,代码来源:home.aspx.cs

示例13: CountRecords

 //TODO: Doesn't accept  single quote
 //TODO: improve focus lost checking
 //TODO: Consider making the database with unique index key!! so you can delete an item based on table selection/ or
 //TODO: change the delete method to accept string from the grid.
 //TODO: Make delete button dissapear when nothing is selected/ or make it read delete parameter from the grid.
 //TODO: Make append/change function.
 //TODO: Test github new master branch
 public void CountRecords()
 {
     string command = "SELECT * FROM PasterData";
     sqlite_connection.Open();
     SQLiteCommand sqlite_command = sqlite_connection.CreateCommand();
     sqlite_command.CommandText = command;
     sqlite_datareader = sqlite_command.ExecuteReader();
     while (sqlite_datareader.Read()) // Read() returns true if there is still a result line to read
     {
         string myreader = sqlite_datareader.GetString(0);
         if (_maxNumber < Convert.ToInt32(myreader))
         {
             _maxNumber = Convert.ToInt32(myreader);
         }
         _count++;
     }
 }
开发者ID:thebaske,项目名称:CpPasterAdvanced,代码行数:24,代码来源:ControlsDashboard.cs

示例14: ReadDateTime

        public static object ReadDateTime(SQLiteDataReader reader, int idx)
        {
            try
            {
                if (!reader.IsDBNull(idx))
                {
                    string val = reader.GetString(idx);
                    if(val.Length != 0)
                    {
                        return DateTime.Parse(val);
                    }
                }

                return new DateTime(1970, 1, 1);
            }
            catch (Exception)
            {
                return new DateTime(1970, 1, 1);
            }
        }
开发者ID:Thorsten1982,项目名称:MPExtended,代码行数:20,代码来源:DataReaders.cs

示例15: ReadHeader

        void ReadHeader()
        {
            SQLiteCommand command = _connection.CreateCommand();
            command.CommandText = "SELECT key, value FROM header;";
            _reader = command.ExecuteReader();

            while (_reader.Read())
            {
                var key = _reader.GetString(0);
                var value = _reader.GetValue(1);

                if (key.ToLower() == "clientbuild")
                {
                    int build;
                    if (int.TryParse(value.ToString(), out build))
                        SetBuild(build);

                    break;
                }
            }

            _reader.Close();
        }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:23,代码来源:SQLitePacketReader.cs


注:本文中的System.Data.SQLite.SQLiteDataReader.GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。