我使用 ms sql compact 4.0 for db,我只想问如何在点“。”之后排除单词。添加我的上下文提示。
就像我的数据库中的示例:http: //oi41.tinypic.com/2f06053.jpg
对于 TypeName "Indicators",例如在 Indicators.RelativeStrengthIndex 中,我只希望保留单词 "Indicators" 并删除单词 ".RelativeStrengthIndex" 或在点之后。和其他人一样。
DataExplorer://ObjDB.sdf/Table/[tb_CsType]
出现在我的上下文提示中:
http://oi41.tinypic.com/2j5xczm.jpg
我的自动完成代码:
string conStr = @"Data Source=C:\Users\z\Desktop\Prot\DB\ObjDB.sdf";
SqlCeDataReader sqldrAllData;
SqlCeConnection sqlCon = new SqlCeConnection(conStr);
///1
SqlCeCommand sqlCmd = new SqlCeCommand("Select TypeName, Syntax, Description From tb_CsType", sqlCon);
///2
//SqlCeCommand sqlCmd2 = new SqlCeCommand("Select TypeName, Syntax, Description From tb_CsMember", sqlCon);
sqlCon.Open();
sqldrAllData = sqlCmd.ExecuteReader();
List<string> lstTypeName = new List<string>();
while (sqldrAllData.Read())
{
lstTypeName.Add(sqldrAllData["TypeName"].ToString());
}
foreach (var word in lstTypeName)
yield return (new Autoc(word) { ImageIndex = 3 });
sqlCon.Close();
然后问题是我如何在“。”之后排除单词。在我的 sql 中。提前致谢!更多的力量!