日期:2014-05-17 浏览次数:20597 次
OleDbConnection myConnectionString = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=D:\\Visual Studio 2008\\WebSites\\4-21\\App_Data\\media.mdb");
OleDbCommand myExecuteQuery = new OleDbCommand("insert into Media(MName,MUppath,MPlaypath,MImgpath) values (@MName, @MUppath,MPlaypath,@MImgpath)");
myExecuteQuery.Parameters.Add("MName", MediaName);
myExecuteQuery.Parameters.Add("MUppath", PublicMethod.upFile + fileName);
myExecuteQuery.Parameters.Add("MPlaypath", PublicMethod.playFile + playName);
myExecuteQuery.Parameters.Add("MImgpath", PublicMethod.imgFile + imgName);
myConnectionString.Open();
myExecuteQuery.ExecuteNonQuery();
myConnectionString.Close();
this.Dispose();