|
SmtpClient smtpclient = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromaddress = new MailAddress("support@euro-asianweddings.com", "Jayanti Popat");
MailAddress toaddress = new MailAddress("info", "Infotech");
message.From = fromaddress;
message.To.Add(toaddress);
message.IsBodyHtml = true;
message.Subject = "New Registration Alert s.com !";
message.Body = "New Registration one With E-mail ID:" + user_mail + "and User name : " + user_name;
smtpclient.Port = 25;
smtpclient.Host = "mx.infotechahm.com";
smtpclient.Send(message);
modified on Saturday, December 26, 2009 7:06 AM
|
|
|
|
|
try
{
SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromaddress = new MailAddress(txt_mail.Text, txt_name.Text);
message.From = fromaddress;
message.To.Add("irf@iehahm.com");
message.Subject = txt_subject.Text;
message.Body = txt_feedback.Text;
message.IsBodyHtml = false;
//message.IsBodyHtml = true;
smtp.Send(message);
Label1.Text = "Email successfully sent.";
}
catch (Exception ex)
{
Label1.Text = "send Email Failed." + ex.Message;
}
modified on Saturday, December 26, 2009 7:06 AM
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
public void BindData()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
////SqlCommand cmd = new SqlCommand("select id as ID,store_name as StoreName,sales as Sales,date as Date from store_information", con);
SqlCommand cmd = new SqlCommand("select * from store_information", con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "store_information");
GridView1.DataSource = ds.Tables["store_information"];
GridView1.DataBind();
con.Close();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindData();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//string textbox1 = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("textbox1")).Text .ToString ();
string textbox2 = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("textbox2")).Text .ToString ();
string textbox3 = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("textbox3")).Text .ToString ();
string textbox4 = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("textbox4")).Text .ToString ();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
//cmd.CommandText = "UPDATE store_information SET id ='" + textbox1.Text + "',store_name ='" + textbox2.Text + "',sales ='" + textbox3.Text + "',date ='" + textbox4.Text + "' WHERE id='" + GridView1.DataKeys[e.RowIndex].Values[0].ToString() + "'";
//cmd.CommandText = "UPDATE store_information SET id = + textbox1.Text + ,store_name ='" + textbox2.Text + "',sales ='" + textbox3.Text + "',date ='" + textbox4.Text + "' WHERE id='" + GridView1.DataKeys[e.RowIndex].Values[0].ToString() + "'";
cmd .CommandText ="UPDATE store_information SET store_name='" + textbox2 .ToString () + "',sales='" + textbox3 .ToString () + "',date='" + textbox4 .ToString () + "' where id='" + GridView1 .DataKeys [e.RowIndex ].Values[0].ToString () + "'";
con.Open();
cmd.ExecuteNonQuery();
GridView1.EditIndex = -1;
BindData();
con.Close();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
BindData();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindData();
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("AddNew"))
{
string text_store = ((TextBox)GridView1.FooterRow.FindControl("text_store")).Attributes .Add("onkeypress","return validate()").Text.ToString();
string txt_sales = ((TextBox)GridView1.FooterRow.FindControl("txt_sales")).Text.ToString();
string txt_date = ((TextBox)GridView1.FooterRow.FindControl("txt_date")).Text.ToString();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
//cmd.CommandText = "UPDATE store_information SET id ='" + textbox1.Text + "',store_name ='" + textbox2.Text + "',sales ='" + textbox3.Text + "',date ='" + textbox4.Text + "' WHERE id='" + GridView1.DataKeys[e.RowIndex].Values[0].ToString() + "'";
//cmd.CommandText = "UPDATE store_information SET id = + textbox1.Text + ,store_name ='" + textbox2.Text + "',sales ='" + textbox3.Text + "',date ='" + textbox4.Text + "' WHERE id='" + GridView1.DataKeys[e.RowIndex].Values[0].ToString() + "'";
cmd.CommandText = "INSERT INTO store_information (store_name,sales,date) VALUES('" + text_store.ToString() + "','" + txt_sales.ToString() + "','" + txt_date.ToString() + "')";
con.Open();
cmd.ExecuteNonQuery();
GridView1.EditIndex = -1;
BindData();
con.Close();
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "DELETE FROM store_information WHERE id='" + GridView1.DataKeys[e.RowIndex].Values[0].ToString() + "'";
con.Open();
cmd.ExecuteNonQuery();
BindData();
con.Close();
}
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack )
{
this.Binddata();
}
}
public void Binddata()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString1"].ConnectionString);
//SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd=new SqlCommand ("select * from store_information",con );
con .Open ();
SqlDataAdapter DA=new SqlDataAdapter (cmd);
DataSet ds=new DataSet ();
DA.Fill (ds,"store_information");
DataList1 .DataSource =ds.Tables["store_information"];
DataList1 .DataBind ();
PagedDataSource page=new PagedDataSource() ;
page.AllowPaging = true;
page.DataSource = ds.Tables["store_information"].DefaultView ;
page.PageSize = 1;
page.CurrentPageIndex = currentpage;
ViewState["TotalPages"] = page.PageCount;
this.lblPageInfo.Text = + (currentpage + 1) + "/" + page.PageCount;
this.lbtnPrevious.Enabled = !page.IsFirstPage;
this.lbtnNext.Enabled = !page.IsLastPage;
this.lbtnFirst.Enabled = !page.IsFirstPage;
this.lbtnLast.Enabled = !page.IsLastPage;
DataList1.DataSource = page;
DataList1.DataBind();
}
public int currentpage
{
get
{
object obj = this.ViewState["_currentpage"];
int _currentpage = 0;
if (obj == null)
{
_currentpage = 0;
}
else
{
_currentpage = (int)obj;
}
return _currentpage ;
}
set
{
ViewState["_currentpage"] = value ;
}
}
public int fistIndex
{
get
{
int _FirstIndex = 0;
if (ViewState["_FirstIndex"] == null)
{
_FirstIndex = 0;
}
else
{
_FirstIndex = Convert.ToInt32(ViewState["_FirstIndex"]);
}
return _FirstIndex;
}
set { ViewState["_FirstIndex"] = value; }
}
public int lastIndex
{
get
{
int _LastIndex = 0;
if (ViewState["_LastIndex"] == null)
{
_LastIndex = 0;
}
else
{
_LastIndex = Convert.ToInt32(ViewState["_LastIndex"]);
}
return _LastIndex;
}
set { ViewState["_LastIndex"] = value; }
}
private void doPaging()
{
DataTable dt = new DataTable();
dt.Columns.Add("PageIndex");
dt.Columns.Add("PageText");
fistIndex = currentpage - 5;
if (currentpage > 5)
{
lastIndex = currentpage + 5;
}
else
{
lastIndex = 10;
}
if (lastIndex > Convert.ToInt32(ViewState["TotalPages"]))
{
lastIndex = Convert.ToInt32(ViewState["TotalPages"]);
fistIndex = lastIndex - 10;
}
if (fistIndex < 0)
{
fistIndex = 0;
}
for (int i = fistIndex; i < lastIndex; i++)
{
DataRow dr = dt.NewRow();
dr[0] = i;
dr[1] = i + 1;
dt.Rows.Add(dr);
}
this.DataList1 .DataSource = dt;
this.DataList1 .DataBind();
}
protected void lbtnFirst_Click(object sender, EventArgs e)
{
currentpage = 0;
this.Binddata();
}
protected void lbtnLast_Click(object sender, EventArgs e)
{
currentpage = (Convert.ToInt32(ViewState["TotalPages"]) - 1);
this.Binddata();
}
protected void lbtnNext_Click(object sender, EventArgs e)
{
currentpage += 1;
this.Binddata();
}
protected void lbtnPrevious_Click(object sender, EventArgs e)
{
currentpage -= 1;
this.Binddata();
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName.Equals("Paging"))
{
currentpage = Convert.ToInt16(e.CommandArgument.ToString());
this.Binddata();
}
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
LinkButton lnkbtnPage = (LinkButton)e.Item.FindControl("LinkButton1");
if (lnkbtnPage.CommandArgument.ToString() == currentpage.ToString())
{
lnkbtnPage.Enabled = false;
lnkbtnPage.Style.Add("fone-size", "14px");
lnkbtnPage.Font.Bold = true;
}
}
|
|
|
|
|
protected void Button1_Click(object sender, EventArgs e)
{
bool atLeastOneRowDeleted = false;
foreach (GridViewRow row in GridView1 .Rows)
{
CheckBox cbox = (CheckBox)row.FindControl("check_del");
if (cbox != null && cbox.Checked)
{
atLeastOneRowDeleted = true;
int id = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
}
if (cbox.Checked == true)
{
//Label5.Visible = false ;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString1"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "DELETE FROM store_information WHERE id='" + GridView1.DataKeys[row .RowIndex].Values[0].ToString() + "'";
con.Open();
cmd.ExecuteNonQuery();
Rebind();
con.Close();
Response.Write("<script> confirm('Are you sure you want to delete record ?')</script>");
}
else
{
Response.Write("<script> alert('Please Checked Selected Record !')</script>");
//Label5.Visible = true;
}
}
}
|
|
|
|
|
Label1.Text = OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.UsersCount.ToString();
webconfig file :-
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="OnlineActiveUsers" type="OnlineActiveUsers.OnlineUsersModule"/>
</httpModules>
Global asax file :=
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.UpdateForUserLeave();
}
|
|
|
|
|
Label1.Visible = true;
Image16.Visible = true;
string ad = txt_to.Text.ToString();
try
{
SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromaddress = new MailAddress("support@m.com", txt_name.Text );
message.From = fromaddress;
//message.To.Add("ca@rediffmail.com");
message.To.Add(ad );
message.Subject = txt_subject.Text;
message.Body = txt_body.Text;
// Attachment attatchfile = new Attachment(FileUpload1 .PostedFile.InputStream, FileUpload1 .FileName);
// message.Attachments.Add(attatchfile);
message.IsBodyHtml = false;
//message.IsBodyHtml = true;
smtp.Host= "hm.com";
smtp.Port = 25;
smtp.UseDefaultCredentials = true;
smtp.Credentials = new System.Net.NetworkCredential("support@ertm.com", "16575767");
smtp.Send(message);
Label1.Text = "Your Feedback Successfully Sent.";
}
catch (Exception ex)
{
Label1.Text = "Send Feedback Failed." + ex.Message;
}
modified on Saturday, December 26, 2009 7:07 AM
|
|
|
|
|
string ad = "mailtoan@rediffmail.com";
string ad1 = "callrediffmail.com";
string ad2 = "ir@ibibo.com";
try
{
SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromaddress = new MailAddress("suort@inhm.com");
message.From = fromaddress;
message.To.Add(ad);
message.CC.Add(ad1);
message.Bcc.Add(ad2);
message.Subject = "Project Sample";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter(sb);
Html32TextWriter htmltw = new Html32TextWriter(sw);
rpt1.RenderControl(htmltw);
string gridstr = sb.ToString();
message.Body = "Testing Email." + gridstr;
message.IsBodyHtml = true ;
//smtp.Host = "mail.pryjutrjfrd.com";
smtp.Host = "mx.ifghfhfm.com";
smtp.Port = 25;
smtp.UseDefaultCredentials = true;
//smtp.Credentials = new System.Net.NetworkCredential("suresh@rtytry.com", "1rty");
smtp.Credentials = new System.Net.NetworkCredential("supfghport@im.com", "1fghfh");
smtp.Send(message);
Response.Write("Your Feedback Successfully Sent.");
}
catch (Exception ex)
{
Response.Write("Send Feedback Failed." + ex.Message);
}
modified on Saturday, December 26, 2009 7:09 AM
|
|
|
|
|
where sector='" + Session["search_by"].ToString() + "' or sector2 like'" + Session["search_by"].ToString() + "%' or sector2 like'%" + Session["search_by"].ToString() + "' or sector2 like'%" + Session["search_by"].ToString() + "%' order by RNO asc
|
|
|
|
|
<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://dynamicdrive.com');">Click here to make Orkut.com your default homepage</a>
***************
<A class=chlnk style="CURSOR: hand; font-decoration: underline" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.javascriptfreecode.com');"
href="http://www.javascriptfreecode.com"> Set Home Page</A><br><font face="Tahoma">
|
|
|
|
|
// Tree 3 parent nodes
SqlConnection con23 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd23 = new SqlCommand("select industry from industry id where id in(21,22,23,24,25,26,27,28,29,30)order by industry desc", con23);
DataSet ds23 = new DataSet("TreeView");
con23.Open();
SqlDataReader dr23 = cmd23.ExecuteReader();
//string currentNode = String.Empty;
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr23.Read())
{
TreeNode node23 = new TreeNode();
node23.Text = dr23[0].ToString();
TreeView3.Nodes.AddAt(0, node23);
//Child node
SqlConnection con123 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd123 = new SqlCommand("select subindustry from subindustry where industry='" + node23.Text.ToString() + "'order by subindustry desc", con123);
DataSet ds123 = new DataSet("TreeView");
con123.Open();
SqlDataReader dr123 = cmd123.ExecuteReader();
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr123.Read())
{
TreeNode node123 = new TreeNode();
node123.Text = dr123[0].ToString();
TreeView3.Nodes[0].ChildNodes.AddAt(0, node123);
node123.NavigateUrl = "~/Application/TreeView_serch.aspx?name=" + node123.Text.ToString() + "";
node123.CollapseAll();
//leaf nodes(Sub Child Node)
SqlConnection con1123 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd1123 = new SqlCommand("select product from product where subindustry='" + node123.Text.ToString() + "'order by product desc", con1123);
DataSet ds112 = new DataSet("TreeView");
con1123.Open();
SqlDataReader dr1123 = cmd1123.ExecuteReader();
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr1123.Read())
{
TreeNode node1123 = new TreeNode();
node1123.Text = dr1123[0].ToString();
TreeView3.Nodes[0].ChildNodes[0].ChildNodes.AddAt(0, node1123);
node1123.NavigateUrl = "~/Application/TreeView_serch_product.aspx?name=" + node1123.Text.ToString() + "";
}
dr1123.Close();
con1123.Close();
}
dr123.Close();
con123.Close();
}
dr23.Close();
con23.Close();
|
|
|
|
|
SqlConnection con23 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd23 = new SqlCommand("select industry from industry id where id in(21,22,23,24,25,26,27,28,29,30)order by industry desc", con23);
DataSet ds23 = new DataSet("TreeView");
con23.Open();
SqlDataReader dr23 = cmd23.ExecuteReader();
//string currentNode = String.Empty;
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr23.Read())
{
TreeNode node23 = new TreeNode();
node23.Text = dr23[0].ToString();
TreeView3.Nodes.AddAt(0, node23);
//Child node
SqlConnection con123 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd123 = new SqlCommand("select subindustry from subindustry where industry='" + node23.Text.ToString() + "'order by subindustry desc", con123);
DataSet ds123 = new DataSet("TreeView");
con123.Open();
SqlDataReader dr123 = cmd123.ExecuteReader();
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr123.Read())
{
TreeNode node123 = new TreeNode();
node123.Text = dr123[0].ToString();
TreeView3.Nodes[0].ChildNodes.AddAt(0, node123);
node123.NavigateUrl = "~/Application/TreeView_serch.aspx?name=" + node123.Text.ToString() + "";
node123.CollapseAll();
//leaf nodes(Sub Child Node)
SqlConnection con1123 = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlstring"].ConnectionString);
SqlCommand cmd1123 = new SqlCommand("select product from product where subindustry='" + node123.Text.ToString() + "'order by product desc", con1123);
DataSet ds112 = new DataSet("TreeView");
con1123.Open();
SqlDataReader dr1123 = cmd1123.ExecuteReader();
//loop tru all MainSubject table columns and add these as ROOT NODES
while (dr1123.Read())
{
TreeNode node1123 = new TreeNode();
node1123.Text = dr1123[0].ToString();
TreeView3.Nodes[0].ChildNodes[0].ChildNodes.AddAt(0, node1123);
node1123.NavigateUrl = "~/Application/TreeView_serch_product.aspx?name=" + node1123.Text.ToString() + "";
}
dr1123.Close();
con1123.Close();
}
dr123.Close();
con123.Close();
}
dr23.Close();
con23.Close();
|
|
|
|
|
Step 1:- Create Store procedure:-
ALTER PROCEDURE dbo.updateregister
@id int,
@fill_by nvarchar(50),
@email nvarchar(50),
@password nvarchar(50),
@gender nvarchar(50),
@pacakage nvarchar(50),
@pay_mode nvarchar(50)
AS
update register set fill_by=@fill_by,email=@email,password=@password,gender=@gender,pacakage=@pacakage,pay_mode=@pay_mode where id=@id
RETURN
|
|
|
|
|
public int update_register(int id, string fill_by, string email, string password, string gender, string pacakage, string pay_mode)
{
SqlConnection con = new SqlConnection(str);
SqlCommand cmd = new SqlCommand("updateregister", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection.Open();
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@fill_by", fill_by);
cmd.Parameters.AddWithValue("@email", email);
cmd.Parameters.AddWithValue("@password", password);
cmd.Parameters.AddWithValue("@gender", gender);
cmd.Parameters.AddWithValue("@pacakage", pacakage);
cmd.Parameters.AddWithValue("@pay_mode", pay_mode);
return cmd.ExecuteNonQuery ();
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//DataList1.DataSource = bindlist();
DataList1.DataSource = DataBind();
DataList1.DataBind();
}
DataBind();
}
public DataTable DataBind()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("select id,fill_by,email,password,gender,pacakage,pay_mode from register ", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "register");
return ds.Tables["register"];
}
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
{
Rock ab=new Rock() ;
int id = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex].ToString());
string fill_by = ((DropDownList)e.Item.FindControl("DropdownList1")).SelectedItem.Text.ToString();
string email = ((TextBox)e.Item.FindControl("TextBox1")).Text;
string password = ((TextBox)e.Item.FindControl("TextBox2")).Text;
string gender = ((DropDownList)e.Item.FindControl("DropDownList2")).SelectedItem.Text.ToString();
string pacakage = ((DropDownList)e.Item.FindControl("DropDownList3")).SelectedItem.Text.ToString();
string pay_mode = ((DropDownList)e.Item.FindControl("DropDownList4")).SelectedItem.Text.ToString();
int result = ab.update_register(id, fill_by, email, password, gender, pacakage, pay_mode);
if (result > 0)
{
Response.Write("Update Succesfully.");
}
else
{
Response.Write("Not Update..");
}
DataList1.EditItemIndex = -1;
DataList1.DataSource = DataBind();
DataList1.DataBind();
}
protected void DataList1_CancelCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = -1;
DataList1.DataSource = DataBind();
DataList1.DataBind();
}
protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = e.Item.ItemIndex;
DataList1.DataSource = DataBind();
DataList1.DataBind();
}
|
|
|
|
|
Session id = System.Convert.ToInt32(Session["estimate_id"]);
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString);
{
SqlCommand cmd1 = new SqlCommand();
cmd1.Connection = con;
cmd1.CommandText = "select * from tender where estimate_id='" + id + "'";
cmd1.CommandType = CommandType.Text;
SqlDataAdapter adp1 = new SqlDataAdapter();
adp1.SelectCommand = cmd1;
DataSet1 ds1 = new DataSet1();
adp1.Fill(ds1, "tender");
ReportDocument rpt1 = new ReportDocument();
rpt1.Load(Server.MapPath("CrystalReport1.rpt"));
rpt1.SetDataSource(ds1);
CrystalReportViewer1.ReportSource = rpt1;
CrystalReportViewer1.Visible = true;
}
|
|
|
|
|
Rock d = new Rock () ;
string father_name = TextBox8.Text;
string father_occupation = TextBox13.Text;
string mother_name = TextBox9.Text;
string mother_occupation = TextBox14.Text;
string brother = DropDownList33.SelectedItem.Text;
string brother_married = DropDownList35.SelectedItem.Text;
string sister = DropDownList34.SelectedItem.Text;
string sister_married = DropDownList36.SelectedItem .Text ;
int result=d.save_submit(father_name ,father_occupation ,mother_name ,mother_occupation ,brother ,brother_married ,sister ,sister_married );
if (result > 0)
{
Response.Write("successprofile.aspx");
}
else
{
Response.Write("notsuccess.aspx");
}
}
|
|
|
|
|
ALTER PROCEDURE dbo.save_submit
@pfather_name nvarchar(50),
@pfather_occupation nvarchar(50),
@pmother_name nvarchar(50),
@pmother_occupation nvarchar(50),
@pbrother nvarchar(50),
@pbrother_married nvarchar(50),
@psister nvarchar(50),
@psister_married nvarchar(50)
AS
insert into seven(father_name,father_occupation,mother_name,mother_occupation,brother,brother_married,sister,sister_married)
values(@pfather_name,@pfather_occupation,@pmother_name,@pmother_occupation,@pbrother,@pbrother_married,@psister,@psister_married)
RETURN
Step 3:-Create a class :-
public class Rock
{
string str = ConfigurationManager.ConnectionStrings["DataBaseConnectionString"].ConnectionString;
public Rock()
{
}
public int save_submit(string father_name, string father_occupation, string mother_name, string mother_occupation, string brother, string brother_married, string sister, string sister_married)
{
SqlConnection con = new SqlConnection(str);
SqlCommand cmd = new SqlCommand("save_submit", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection.Open();
cmd.Parameters.AddWithValue("@pfather_name", father_name);
cmd.Parameters.AddWithValue("@pfather_occupation", father_occupation);
cmd.Parameters.AddWithValue("@pmother_name", mother_name);
cmd.Parameters.AddWithValue("@pmother_occupation", mother_occupation);
cmd.Parameters.AddWithValue("@pbrother", brother);
cmd.Parameters.AddWithValue("@pbrother_married", brother_married);
cmd.Parameters.AddWithValue("@psister", sister);
cmd.Parameters.AddWithValue("@psister_married", sister_married);
return cmd.ExecuteNonQuery();
cmd.Connection.Close();
}
}
|
|
|
|
|
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('label4').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
<body onload ="startTime()">
|
|
|
|
|
Image large on double click
<img src="IMAGES/groom1.jpg" alt="" width="150" height="200" onclick ="this.src='IMAGES/groom1.jpg';this.height=400;this.width=300" ondblclick ="this.src='IMAGES/groom1.jpg';this.height=200;this.width=150"/>
Image large on Mouse Over click
<img src="IMAGES/groom1.jpg" alt="" width="150" height="200" onmouseover ="this.src='IMAGES/groom1.jpg';this.height=400;this.width=300" onmouseout ="this.src='IMAGES/groom1.jpg';this.height=200;this.width=150"/>
Refresh asp page by deafult
Response.addheader(“refresh””5”)
|
|
|
|
|
function ValidateEmail()
{
//For Email. Validation
var EmaiAddress=document.getElementById("txtemail").value;
var RegExEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
if (!RegExEmail.test(EmaiAddress))
{
alert("Please Enter Valid E-mail Adress");
//EmaiAddress=document.getElementById("txtemail").focus();
return false;
}
if(document .getElementById ("txtname").value=="")
{
alert("Enter Your Name.");
document.getElementById ("txtname").focus();
return false;
}
|
|
|
|
|
var Url="^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"
var tempURL=document.getElementById("<%=txtWebURL.ClientID%>").value;
var matchURL=tempURL.match(Url);
if(matchURL==null)
{
alert("Web URL does not look valid");
document.getElementById("<%=txtWebURL.ClientID %>").focus();
return false;
}
else
{
alert("Go Ahead!");
}
}
|
|
|
|
|
It cahange link color when mouse over
.a
{
float:left;
margin-left: 2em;
}
a:hover
{
color: #00F; /* Using blue here */
text-decoration: none; /* eliminates underline */
}
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
DataBind();
}
public void DataBind()
{
PagedDataSource page = new PagedDataSource();
page .AllowPaging =true ;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["yahooConnectionString"].ConnectionString);
SqlCommand cmd=new SqlCommand ("select id,fill_by,email,password,gender,pacakage,pay_mode from register ",con);
SqlDataAdapter da=new SqlDataAdapter (cmd );
DataSet ds=new DataSet ();
da.Fill (ds,"register");
page.DataSource =ds.Tables ["register"].DefaultView;
page .PageSize =2;
page .CurrentPageIndex = CurrentPage ;
DataList1 .DataSource =page ;
DataList1 .DataBind ();
}
public int CurrentPage
{
get
{
// look for current page in ViewState
object o = this.ViewState["_CurrentPage"];
if (o == null)
return 0; // default to showing the first page
else
return (int)o;
}
set
{
this.ViewState["_CurrentPage"] = value;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
CurrentPage -= 1;
DataBind();
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
CurrentPage += 1;
DataBind();
if (page.IsLastPage)
{
LinkButton2_Click = false;
}
}
|
|
|
|
|
session["name"]=textbox1.text \\create session in one page
textbox2.text=seesion["name"].tostring(); //like we can call the session value
Session["ans"] = ans;
Session["total"] = total;
|
|
|
|
|