skip to main |
skip to sidebar
RSS Feeds
Now maintained at http://www.prithviraj.com.np
Now maintained at http://www.prithviraj.com.np
Friday, July 20, 2012
By Unknown
Sunday, July 15, 2012
By Unknown
C:\>cd Windows C:\Windows>cd Microsoft.NET C:\Windows\Microsoft.NET>cd Framework
C:\Windows\Microsoft.NET\Framework\
C:\Windows\Microsoft.NET\Framework>cd v4.* //installing ASP.NET V4.0 here. C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
Friday, July 13, 2012
By Unknown
Wednesday, July 11, 2012
By Unknown
Sunday, July 08, 2012
By Unknown
protected void Page_Load(object sender, EventArgs e) { } int x; // Made a Variable with Datatype Int for Future Use HttpCookie myCookie; // Defined a Cookie named myCookie. protected void Button1_Click(object sender, EventArgs e) { x = Convert.ToInt32(TextBox1.Text); // Converted textbox Value which we earlier Did. myCookie = new HttpCookie("txtValue"); // Assigned Variable myCookie. myCookie.Value = Convert.ToString(x); // Value assigned to myCookie. Response.Cookies.Add(myCookie); //This Simple Made a Cookie that will Expire in Session End. myCookie.Expires = DateTime.Now.AddMinutes(15); // We made is Persistent and stored it for Next 15 minutes. } protected void Button2_Click(object sender, EventArgs e) { HttpCookie storedCook = Request.Cookies["txtValue"]; // Requested from Server for Cookie if (storedCook != null) x = Convert.ToInt32(storedCook.Value); // Converted to Integer again. TextBox1.Text = Convert.ToString(x * x); // Now Printed Value in Textbox. }Now Check....
Sunday, July 08, 2012
By Unknown
protected void Page_Load(object sender, EventArgs e) { } int x; protected void Button1_Click(object sender, EventArgs e) { x = Convert.ToInt32(TextBox1.Text); } protected void Button2_Click(object sender, EventArgs e) { TextBox1.Text = Convert.ToString(x * x); }
Thursday, July 05, 2012
By Unknown
Vehicle No : |
using System.Data; // For Dataset using System.Data.SqlClient; // For SQlConnection/Adaptor using System.Configuration; // Access Consting from Web.Config. using System.Collections.Generic;
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()] public static string[] GetVehicleList(string prefixText, int count, string contextKey) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConToJohn"].ConnectionString); SqlDataAdapter adp = new SqlDataAdapter("Select distinct VehicleNo from VehicleDispatch where VehicleNo like '%" + prefixText + "%'", con); DataSet ds = new DataSet(); adp.Fill(ds, "Vehicles"); string[] VehicleNo = new string[ds.Tables["Vehicles"].Rows.Count]; for (int i = 0; i <= ds.Tables["Vehicles"].Rows.Count - 1; i++) { VehicleNo.SetValue(ds.Tables["Vehicles"].Rows[0][0].ToString(), i); } return VehicleNo; }I have Selected Only Unique Value from Database using SELECT DISTINCT .... command. If you want all records, Simply Change SQL Query to SELECT ..... Will be glad to hear from you... This Post is copied from DotNetFunda where I wrote in Code section.