using System.Data; using System.Data.OleDb; //- OLEDB Connection String var MyStringConnection = "data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"; //- Instantiate the ODBC Class ncTools.ODBCHelper oDB = new ncTools.ODBCHelper(); //- Get the Records OleDbDataReader dr = oDB.MyOleDbRecordSet("SELECT * FROM Customers", MyStringConnection); //- Check for end of file if (dr.HasRows) { //- Loop through all record found while (dr.Read()) { //- Do your thing here } } dr.Close(); oDB = null; //===================================================================================== //-- OLEDB Execute a store procedure. //===================================================================================== //- OLEDB Connection String var MyStringConnection = "data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"; //- Instantiate the ODBC Class ncTools.ODBCHelper oDB = new ncTools.ODBCHelper(); //- Get the result int iResult = oDB..OleDbExecuteQuery("spExecuteStoreProcedure", MyStringConnection); if (iResult>0) { //- Successfully Executed } oDB=null;
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add support@netstair.us to your trusted senders list in your email software.