Click here to Skip to main content
15,887,350 members
Home / Discussions / - Uncategorised posts -
   

- Uncategorised posts -

Please don't post in this forum. If you've posted in this forum it's because you've selected the first forum on the list without thinking through which forum would be best. All messages in this forum are periodically removed.

 
QuestionDoes anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
Eugene Pustovoyt8-Jul-14 21:08
Eugene Pustovoyt8-Jul-14 21:08 
AnswerRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
thatraja1-Aug-14 13:43
professionalthatraja1-Aug-14 13:43 
GeneralRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
Eugene Pustovoyt1-Aug-14 20:47
Eugene Pustovoyt1-Aug-14 20:47 
GeneralRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
thatraja1-Aug-14 21:19
professionalthatraja1-Aug-14 21:19 
GeneralRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
Eugene Pustovoyt1-Aug-14 21:29
Eugene Pustovoyt1-Aug-14 21:29 
GeneralRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
thatraja1-Aug-14 21:33
professionalthatraja1-Aug-14 21:33 
GeneralRe: Does anyone know what happened with Hans Dietrich and his site 'hdsoft.com'? Pin
Eugene Pustovoyt1-Aug-14 21:41
Eugene Pustovoyt1-Aug-14 21:41 
Questiondbsupport Pin
arvind kush12-Jun-14 7:47
arvind kush12-Jun-14 7:47 
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

/// <summary>
/// Summary description for Dbsupport
/// </summary>
public class Dbsupport
{
SqlConnection con;
SqlCommand cmd = new SqlCommand();
DataTable dt = new DataTable();
ListItem lstItem;

public string excep = "", strExp;


string connectionstring = ConfigurationManager.ConnectionStrings["con"].ConnectionString.ToString();

#region get connection string
public void GetCon()
{
try
{
if (con == null)
{

con = new SqlConnection(connectionstring);
con.Open();
}
if (con.State == ConnectionState.Closed)
{
con.Open();
}
}
catch (Exception ex)
{
string abc = ex.Message.ToString();
}
}
#endregion

#region Close Connection to the sql server
public void CloseCon()
{
try
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
catch
{
}
}
#endregion

#region Dispose Connection to the sql server
public void DisposeConnection()
{
try
{
if (!((con == null)))
{
con.Dispose();
con = null;
}
}
catch
{
}
}
#endregion

#region Insert value
public int ExecuteStorProc(string strsql, SqlParameter[] Sparam)
{
int i = 0;
try
{
GetCon();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = strsql;
cmd.CommandTimeout = 1000;

SqlParameter param = new SqlParameter();
foreach (SqlParameter lparam in Sparam)
{
//param=lparam;
cmd.Parameters.Add(lparam);
}
i = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
CloseCon();
DisposeConnection();
return i;
}
catch (Exception ex)
{
excep = ex.Message;
CloseCon();
DisposeConnection();
return i;
}
}
#endregion

#region Retirve the database value in DataTable
public DataTable GetDataTable(string strsql1)
{
GetCon();
DataTable dt = new DataTable();
try
{

SqlDataAdapter da = new SqlDataAdapter();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = strsql1;
cmd.CommandTimeout = 2000;
da.SelectCommand = cmd;
da.Fill(dt);
CloseCon();
DisposeConnection();
return dt;


}
catch (Exception ex)
{
string excep = ex.Message;
CloseCon();
DisposeConnection();
return dt;
}
}
#endregion

#region Execute sqlquery Insert ,update and delete in sql server
public int ExecuteSql(string strsql)
{
int i = 0;
try
{
GetCon();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = strsql;
cmd.CommandTimeout = 100;
i = cmd.ExecuteNonQuery();

cmd.Parameters.Clear();
CloseCon();
DisposeConnection();
return i;
}
catch (Exception ex)
{
strExp = ex.Message;
CloseCon();
DisposeConnection();
return i;
}
}
#endregion

#region Execute sqlTransaction
public int ExecuteSqlTrans(string[] strsql)
{
int i = 0;
SqlTransaction transaction = null;
GetCon();
cmd.Connection = con;
transaction = con.BeginTransaction();
cmd.Transaction = transaction;
cmd.CommandType = CommandType.Text;
try
{
i = 1;
// Assign Transaction to Command
for (int j = 0; j < strsql.Length; j++)
{
cmd.CommandText = strsql[j].ToString().Trim();
cmd.CommandTimeout = 100;
i = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
transaction.Commit();

CloseCon();
DisposeConnection();
return i;
}
catch (Exception ex)
{
i = 0;
string strExp = ex.Message;
transaction.Rollback();
CloseCon();
DisposeConnection();
return i;

}
}
#endregion

#region Retirve database value in DataSet
public DataSet GetDataSet(string strsql)
{
GetCon();
DataSet ds = new DataSet();
ds.Clear();
try
{

SqlDataAdapter da = new SqlDataAdapter();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = strsql;
cmd.CommandTimeout = 1000;
da.SelectCommand = cmd;
da.Fill(ds);
CloseCon();
DisposeConnection();
return ds;


}
catch (Exception ex)
{
string stexp = ex.Message;
CloseCon();
DisposeConnection();
return ds;
}
}
#endregion

#region fill value in dropdown box
public void populateDropdown(DropDownList drpControl, string topstr, string strQuery)
{
//GetCon();
//cmd.CommandText = strQuery;
//cmd.Connection = con;
////Sqlreader = cmd.ExecuteReader();
//da.SelectCommand = cmd;
//dt.Clear();
//da.Fill(dt);
//lstItem = new ListItem();
//lstItem.Text = topstr;
//lstItem.Value = topstr;
//drpControl.Items.Clear();
//drpControl.Items.Add(lstItem);

//DataTableReader Dr = new DataTableReader(dt);
//while (Dr.Read())
//{
// lstItem = new ListItem();
// lstItem.Text = Dr[0].ToString();//Sqlreader[0].ToString();
// lstItem.Value = Dr[0].ToString(); // Sqlreader[0].ToString();

// drpControl.Items.Add(lstItem);
//}
//Dr.Close();


dt = GetDataTable(strQuery);
lstItem = new ListItem();
drpControl.Items.Clear();
lstItem.Text = topstr;
lstItem.Value = topstr;
drpControl.Items.Add(lstItem);
if (dt.Rows.Count > 0)
{


foreach (DataRow dr in dt.Rows)
{

lstItem = new ListItem();
lstItem.Text = dr[0].ToString();
lstItem.Value = dr[0].ToString();
drpControl.Items.Add(lstItem);


}

}



}
#endregion
}
QuestionRe: dbsupport Pin
Richard Deeming12-Jun-14 9:09
mveRichard Deeming12-Jun-14 9:09 
AnswerRe: dbsupport Pin
arvind kush27-Jul-14 17:52
arvind kush27-Jul-14 17:52 
GeneralRe: dbsupport Pin
Richard Deeming28-Jul-14 2:12
mveRichard Deeming28-Jul-14 2:12 
QuestionDo you recommend an alternative to DigitalOcean.com Pin
Member 108647234-Jun-14 9:38
Member 108647234-Jun-14 9:38 
SuggestionRe: Do you recommend an alternative to DigitalOcean.com Pin
Thanks78724-Jun-14 20:47
professionalThanks78724-Jun-14 20:47 
QuestionTo learn multiple languages or not. Pin
qadirv4-Jun-14 4:05
qadirv4-Jun-14 4:05 
AnswerRe: To learn multiple languages or not. Pin
Simon_Whale4-Jun-14 5:05
Simon_Whale4-Jun-14 5:05 
GeneralRe: To learn multiple languages or not. Pin
ZurdoDev6-Jun-14 9:14
professionalZurdoDev6-Jun-14 9:14 
AnswerRe: To learn multiple languages or not. Pin
Albert Holguin17-Jul-14 5:26
professionalAlbert Holguin17-Jul-14 5:26 
GeneralRe: To learn multiple languages or not. Pin
qadirv31-Jul-14 21:19
qadirv31-Jul-14 21:19 
QuestionSYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
aswadmanap22-May-14 18:04
aswadmanap22-May-14 18:04 
AnswerRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
Richard MacCutchan22-May-14 20:47
mveRichard MacCutchan22-May-14 20:47 
GeneralRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
aswadmanap22-May-14 20:55
aswadmanap22-May-14 20:55 
GeneralRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
Richard MacCutchan22-May-14 21:46
mveRichard MacCutchan22-May-14 21:46 
AnswerRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
ZurdoDev6-Jun-14 9:15
professionalZurdoDev6-Jun-14 9:15 
GeneralRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
aswadmanap7-Jun-14 20:58
aswadmanap7-Jun-14 20:58 
GeneralRe: SYSTEM FOR RECORDING AND MONITORING STAFF IN OFFICE WHENEVER THERE ARE GOING OUT OR IN Pin
ZurdoDev8-Jun-14 7:13
professionalZurdoDev8-Jun-14 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.