摘要: 以下两段语句最终效果均为用数据库插入数据,请先对比观察它们的不同:string sql = string.Concat(new object[] {"insert into 表名(字段1,字段2) values('",值1,"','",值2,"')"});string sql = "insert into 表名(字段1,字段2) values('"+值1+"','"+值2+"')";以上两条语句的结果是相同的,但 阅读全文
posted @ 2013-01-07 10:56 yellowshorts 阅读(4020) 评论(0) 推荐(0) 编辑
摘要: 窗体控件中是有个List控件(ASP.Net)和一个ListView控件(WinForm)。 就以ListView为例子吧,ListView控件可以包含很多项,也可以说是一个集合,就让我们来看看它的Items属性吧!publicclassListView:Control{ publicListView.ListViewItemCollectionItems{get;} publicclassListViewItemCollection:IList,ICollection,IEnumerable{ } } ListView的Items类型是ListView.ListViewItemColle.. 阅读全文
posted @ 2013-01-07 10:48 yellowshorts 阅读(5129) 评论(0) 推荐(0) 编辑
摘要: string strcon = "Data Source=.\\SQLEXPRESS;Initial Catalog=Db_Example;Persist Security Info=True;User ID=sa;Password=sa";SqlConnection con = new SqlConnection(strcon);con.Open();string strsql = "select * from SC,Course where SC.Cno=Course.Cno";SqlDataAdapter da = new SqlDataAdapt 阅读全文
posted @ 2013-01-07 10:16 yellowshorts 阅读(1364) 评论(0) 推荐(0) 编辑