public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
if (con.State == ConnectionState.Closed)
{
con.Open();
}
if (con.State == ConnectionState.Closed)
{
con.Open();
}
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from IEP", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
txtp1.Text = dr[1].ToString();
}
dr.Close();
con.Close();
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from [inner] where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
dr.Close();
cmd = new SqlCommand("update [inner] set lblp1=@lblp1 where country=@country and page=@page", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("update [inner] set lblp1=N'"+CKEditor1.Text+"' where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
cmd.ExecuteNonQuery();
}
else
{
dr.Close();
cmd = new SqlCommand("insert into [inner] values(@country,@page,@lblp1)", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("insert into [inner] values('"+ddcountry.SelectedValue+"','"+ddname.SelectedValue+"',N'"+CKEditor1.Text+"')", con);
cmd.ExecuteNonQuery();
}
con.Close();
clsAlert.Show("Data Saved Successfully");
CKEditor1.ReadOnly = true;
}
catch (Exception ex)
{
}
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from [inner] where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
dr.Close();
cmd = new SqlCommand("update [inner] set lblp1=@lblp1 where country=@country and page=@page", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("update [inner] set lblp1=N'"+CKEditor1.Text+"' where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
cmd.ExecuteNonQuery();
}
else
{
dr.Close();
cmd = new SqlCommand("insert into [inner] values(@country,@page,@lblp1)", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("insert into [inner] values('"+ddcountry.SelectedValue+"','"+ddname.SelectedValue+"',N'"+CKEditor1.Text+"')", con);
cmd.ExecuteNonQuery();
}
con.Close();
clsAlert.Show("Data Saved Successfully");
CKEditor1.ReadOnly = true;
}
catch (Exception ex)
{
}
<%@ Register Src="USRSupplierDetails.ascx" TagName="USRSupplierDetails" TagPrefix="uc1" %>
<uc1:usrsupplierdetails id="USRSupplierDetails1" runat="server" />
<script type="text/javascript" language="javascript">
function getfacid() {
var facid = $('#<%=ddl_facility.ClientID%>').val()
$("#<%= hdnfacid.ClientID %>").val(facid);
var hval = document.getElementById('<%=hdnfacid.ClientID %>').value;
}
</script>
<input id="hdnfacid" runat="server" type="hidden" />
<asp:DropDownList runat="server" ID="ddl_facility" Width="170px" onchange="getfacid()">
</asp:DropDownList>
function getfacid() {
var facid = $('#<%=ddl_facility.ClientID%>').val()
$("#<%= hdnfacid.ClientID %>").val(facid);
var hval = document.getElementById('<%=hdnfacid.ClientID %>').value;
}
</script>
<input id="hdnfacid" runat="server" type="hidden" />
<asp:DropDownList runat="server" ID="ddl_facility" Width="170px" onchange="getfacid()">
</asp:DropDownList>

