- mailserver_latest.zip
- MailServer_latest
- LumiSoft
- DelObj.exe
- MailServer
- Application
- errors.txt
- Filters
- lsSpamFilter
- lsVirusFilter
- help.txt
- Help
- Server&API
- Help
- LSServer&API.chm
- Untitled.ndoc
- User
- ENG
- _Images
- alias.jpg
- aliases.jpg
- domain.jpg
- domains.jpg
- filter.jpg
- filters.jpg
- logo.jpg
- main.jpg
- route.jpg
- routing.jpg
- securit1.jpg
- securit2.jpg
- security.jpg
- server.jpg
- sys_delivery.jpg
- sys_general.jpg
- sys_imap.jpg
- sys_pop3.jpg
- sys_smtp.jpg
- user1.jpg
- user2.jpg
- users.jpg
- Admin
- def.htm
- Install
- Intro
- mailserver.hhp
- MailServer_ENG.chm
- Problems
- Start.htm
- Started
- style.css
- Table of Contents.hhc
- Windows
- Install
- MailServer
- MailServerManager
- RFC
- ServerAPI
- SQL_Database
- Stuff
- NNTP
- ToDo.txt
- version.txt
- WebMail
- Net
- NetHelp
- Help
- LumiSoft.Net_Help.chm
- Untitled.ndoc
- UI
- Help
- Images
- outlookBar.gif
- outlookBarFullSelect.gif
- outlookBarIconSelect.gif
- outlookBarSmallIcon.gif
- outlookBarStuckenItem.gif
- Lib
- TestUI
- ToDo.txt
- Tools
- UI_rem_ISupportInitialize
- UI_version.txt
- smtppop3mailserver.zip
- LumiSoft
- DelObj.exe
- MailServer
- Net
- UI
- Help
- Images
- outlookBar.gif
- outlookBarFullSelect.gif
- outlookBarIconSelect.gif
- outlookBarSmallIcon.gif
- outlookBarStuckenItem.gif
- Lib
- TestUI
- UI_version.txt
|
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
namespace LumiSoft.MailServer
{
/// <summary>
/// Summary description for WSqlCommand.
/// </summary>
internal class WSqlCommand : IDisposable
{
private SqlCommand m_SqlCmd = null;
private string m_connStr = "";
/// <summary>
/// Default constructor.
/// </summary>
/// <param name="connectionString">Connection string.</param>
/// <param name="commandText">Command text.</param>
public WSqlCommand(string connectionString,string commandText)
{
m_connStr = connectionString;
m_SqlCmd = new SqlCommand(commandText);
m_SqlCmd.CommandType = CommandType.StoredProcedure;
m_SqlCmd.CommandTimeout = 180;
}
#region function Dispose
public void Dispose()
{
if(m_SqlCmd != null){
m_SqlCmd.Dispose();
}
}
#endregion
#region function AddParameter
/// <summary>
/// Adds parameter to Sql Command.
/// </summary>
/// <param name="name">Parameter name.</param>
/// <param name="dbType">Parameter datatype.</param>
/// <param name="value">Parameter value.</param>
public void AddParameter(string name,SqlDbType dbType,object value)
{
SqlDbType dbTyp = dbType;
object val = value;
if(val is DateTime){
DateTime date = (DateTime)value;
val = new DateTime(date.Year,date.Month,date.Day,0,0,0,0);
}
if(dbType == SqlDbType.UniqueIdentifier){
dbTyp = SqlDbType.NVarChar;
string guid = val.ToString();
if(guid.Length < 1){
return;
}
}
m_SqlCmd.Parameters.Add(name,dbTyp).Value = val;
}
#endregion
#region fucntion Execute
/// <summary>
/// Executes command.
/// </summary>
/// <returns></returns>
public DataSet Execute()
{
DataSet dsRetVal = null;
using(SqlConnection con = new SqlConnection(m_connStr)){
con.Open();
m_SqlCmd.Connection = con;
dsRetVal = new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter(m_SqlCmd);
adapter.Fill(dsRetVal);
adapter.Dispose();
}
return dsRetVal;
}
#endregion
#region Properties Implementaion
/// <summary>
/// Gets or sets command timeout time.
/// </summary>
public int CommandTimeout
{
get{ return m_SqlCmd.CommandTimeout; }
set{ m_SqlCmd.CommandTimeout = value; }
}
/// <summary>
/// Gets or sets command type.
/// </summary>
public CommandType CommandType
{
get{ return m_SqlCmd.CommandType; }
set{ m_SqlCmd.CommandType = value; }
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.