ASP.NET - need project to search record frm database efficient algorithm

Asked By mani on 11-Apr-12 05:03 PM
hi..i need to download sample project to to search record from different table or database using any efficient algorithm please any help??
Robbe Morris replied to mani on 11-Apr-12 05:03 PM
SqlConnection, SqlCommand, SqlDataAdapter, DataTable

Put these in google.
help
hii experts. . ! i m making the project of text +"' here is how you can do that protected void Button1_Click( object sender, EventArgs e) { SqlConnection con = new SqlConnection ( "Connection String" ); con.Open(); SqlCommand comm = new SqlCommand ( "select * from Table where employee name = '" + comboBox1.Text+ "'" , con); SqlDataAdapter da = new SqlDataAdapter (comm); DataTable dt = new DataTable (); da.Fill(dt); con.Close(); if (dt
dtTable public static DataTable dtTable; / / Get the connectionstring from the webconfig and declare a global SqlConnection "SqlConnection" public static string connectionString = ConfigurationManager.AppSettings["ConnectionString"]; public SqlConnection SqlConnection = new SqlConnection(connectionString); / / Declare a global SqlDataAdapter SqlDataAdapter public SqlDataAdapter SqlDataAdapter = new SqlDataAdapter(); / / Declare a global SqlCommand SqlCommand public SqlCommand SqlCommand = new SqlCommand(); protected void
This is the code I am using: string sconStr = System.Configuration.ConfigurationManager.ConnectionStrings["EticketingconnectionString"].ToString(); SqlConnection sqlconnection = new SqlConnection(sconStr); sqlconnection.Close(); sqlconnection.Open(); string u = "select username, password from dbo.Registration where username = '" + UsernameTextBox.Text + "'&password = '"+PasswordTextBox.Text+"'"; SqlCommand sqlcomm = new SqlCommand(u, sqlconnection); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlcomm; sqlcomm.CommandType = CommandType.Text; sqlcomm.ExecuteNonQuery(); DataTable dt
to perform batch insert.were i am going wrong.i does not able to insert. SqlConnection con = new SqlConnection (); SqlCommand sqlcommand = new SqlCommand (); SqlDataAdapter adapt = new SqlDataAdapter (sqlcommand); con.ConnectionString = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ToString(); con.Open(); sqlcommand.CommandType = CommandType .StoredProcedure; sqlcommand.CommandText = "usp_inssample
Jun-13 10:16 AM CS1502: The best overloaded method match for 'System.Data.SqlClient.SqlCommand.SqlCommand(string, System.Data.SqlClient.SqlConnection)' has some invalid arguments Can anyone help me. . . . My code : void BindGrid() { Dataset ds = new Dataset (); SqlCommand cmd = new SqlCommand (); SqlConnection conn = new SqlConnection (); DataGrid grdsrch = new DataGrid (); try { cmd.CommandText = "MKDB_connstring" ; cmd.CommandType = CommandType .StoredProcedure; cmd.Parameters.Add ERROR showing here cmd.Parameters.Add( new SqlParameter ( "@searchvalue" , TextBox1.Text.ToString)); / / ERROR showing here SqlDataAdapter adp = new SqlDataAdapter (); cmd.Connection = con; con.open(); / / ERROR showing here adp = new SqlDataAdapter (cmd
SqlConnection sconn = new SqlConnection("Data Source = .; Initial Catalog = ram; Trusted_Connection = True;"); SqlCommand cmd = new SqlCommand(); DataSet ds = new DataSet(); SqlDataAdapter adpcust = new SqlDataAdapter(); SqlDataAdapter adorder = new SqlDataAdapter(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) ddlbind(); / / bindcustdataset(); } public void connection() { string
Private Sub DoUpdate() SyncDatabase("update", "DSTransOverride1") End lngPlan_Year As Object _ ) As Object ' construct new connection And command objects Dim conn As SqlConnection = GetConn() Dim cmd As SqlCommand = GetSprocCmd("prc_TransOverride_upd", conn) Dim param As SqlParameter ' add return value param param = New SqlParameter("@RETURN_VALUE
simple code for login and change password using asp with sql server Login protected void BtnLogin_Click( object sender, EventArgs e) { String conn = "<Your connectionSTring> " ; SqlConnection connection = new SqlConnection (conn); connection.Open(); string q = "select Count(*) from users where username = '" + txtuname.Text + "' AND pwd = '" + txtpwd.Text + "'" ; SqlCommand comm = new SqlCommand (q, connection); int result = ( int )comm.ExecuteScalar(); if (result> 0) { Session[ "user" ] = txtuname.Text.ToString old passwod is same as new pass')< / script> " ); return ; } else { string user = Session[ "user" ].ToString(); SqlConnection conn = new SqlConnection ( "connectionString" ); string q = "Update users set password = '" + txtNewPassword.Text + "' where username = '" + user
this snippet in Page_Load. string strSQLconnection = "Data Source = dbServer;Initial Catalog = testDB;Integrated Security = True"; SqlConnection sqlConnection = new SqlConnection(strSQLconnection); SqlCommand sqlCommand = new SqlCommand("GetDetails", sqlConnection); sqlCommand.CommandType = CommandType.StoredProcedure; sqlConnection.Open(); SqlDataReader reader = sqlCommand.ExecuteReader(); GridView1.DataSource = reader; GridView1.DataBind(); Check