using System.Data; using System.Data.Sql; using System.Data.SqlClient; //- Sql 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 SqlDataReader dr = oDB.SqlRecordSet("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; //===================================================================================== //-- SQL Execute a store procedure. //===================================================================================== //- Sql 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.SqlExecuteQuery("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.