在我的 SQLite 数据库中,我有一个nvarchar列。But when select this column, want to select 30 first character. 我测试substr和substring但不是真的。我怎样才能做到这一点?谢谢
public static DataTable FetchNotesList(int PointId)
{
DataTable FetchNotesListDataTable = new DataTable();
using (SQLiteConnection FetchNotesListConnection = new SQLiteConnection(BLL.SettinClass.IASQLiteConnectionString))
{
FetchNotesListConnection.Open();
SQLiteCommand FetchNotesListCommand = new SQLiteCommand();//FetchNotesListConnection.CreateCommand();
FetchNotesListCommand.Connection = FetchNotesListConnection;
FetchNotesListCommand.CommandText = "SELECT NoteId, SUBSTR(NoteContent,0,10), NoteDate, NoteDateTime FROM PointsNotes WHERE PointsId = @PointId";
FetchNotesListCommand.Parameters.AddWithValue("PointId", PointId);
SQLiteDataAdapter FetchNotesListDataAdapter = new SQLiteDataAdapter(FetchNotesListCommand);
FetchNotesListDataAdapter.Fill(FetchNotesListDataTable);
}
return FetchNotesListDataTable;
}
我使用此代码。日期列显示但notecontent不显示在gridex中