hi i am trying to make a page so what this page do is ...... first it open a new browser and open the url www.yahoo.com and then when it opens the yahoo home page it also login with my username and password .... i want to supply him my username and password from my own page ...i want to know that how i can be able to do this ... and one more thing that is is this can be one using a windows application or a web application that is my web page ... ok seea bye Mazhar Hussain Mazhar Hussain
jacal99
Posts
-
how to open url and login -
Help in data selectinghi i can select all the data from access database using c# ... now i want to do is get the data from the database and display it in my textbox .... i am using repeater control to get data from database ... but unable to display it in my textbox field .... here is my all code with repeter control for selecting data. :) file name is db2.aspx <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> void Page_Load(object sender, EventArgs e) { } void Button1_Click(object sender, EventArgs e) { OleDbConnection objConnection = null; OleDbCommand objCmd = null; string strConnection, strSQL; strConnection = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\sample.mdb"); objConnection = new OleDbConnection(strConnection); objConnection.Open(); strSQL = "INSERT INTO emp (fname, lname) VALUES ( '"+TextBox1.Text+"' , '"+TextBox2.Text+"' )"; objCmd = new OleDbCommand(strSQL, objConnection); objCmd.ExecuteNonQuery(); objConnection.Close(); TextBox1.Text=""; TextBox2.Text=""; string oledbcon,oledbcom; oledbcon = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\sample.mdb"); OleDbDataAdapter mycommand1 = new OleDbDataAdapter("Select fname,lname from emp",oledbcon); DataSet ds = new DataSet(); mycommand1.Fill (ds,"emp"); rept.DataSource = ds.Tables["emp"].DefaultView; rept.DataBind(); objConnection.Close(); }
Access DataBase Is Inserting And View Data In Repeater.
First Name:
Last Name: -
problem in simple calculationHi Ryan ... :-) buddy the code works ... thx now i can do my job easy ... thx again ... seea bye Mazhar Hussain
-
problem in simple calculationHi Ryan you modify my code but it is not working ... it is giving me the same error that Compiler Error Message: CS0030: Cannot convert type 'int' to 'string' on this line your_amount.Text = (string)(a/b); any other brights ideas ... me waiting ... Mazhar Hussain
-
problem in simple calculationhi i am new to c# programming and i am getting problem in asp.net i am trying to make simple division in two fields and get their result in the thired textbox on a button click. this is my code void Button2_Click(object sender, EventArgs e) { int val = int.Parse(tb1.Text); lbl1.Text = val.ToString(); int a = int.Parse(total_fee.Text); int b = int.Parse(c_length.Text); int c = int.Parse(your_amount.Text); your_amount.Text = c.ToString(a/b); } Total Fee:
Course Length:
Your balance: Mazhar Hussain
-
help in c# web servicehi i am trying to make a simple web application using web services with c# web matrix i have get the data from html page and i can print it on my aspx page but i could not be able to pass my data to my web services in my web services i want to send my data in access database we i show you my code as under that i used ... this is my html code
First Name:
Last Name:
this is my aspx page code <%@ Page Language="C#" Debug=true %> void Page_Load(object src,EventArgs e) { String fn,ln; fn = Request.Form.Get("fname"); ln=Request.Form.Get("lname"); Response.Write("Your First Name is = " +"<b>" +fn +"</b>" +"<br>"); Response.Write("Your Last Name is = " +"<b>" +ln +"</b>" +"<br>"); } and this is my web services code <%@ WebService language="C#" Debug="True" class="my" %> using System; using System.Web.Services; using System.Xml.Serialization; public class my { [WebMethod] public void Add(string a, string b) { OleDbConnection objConnection = null; OleDbCommand objCmd = null; string strConnection, strSQL; strConnection = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\t1.mdb"); // Create and open the connection object objConnection = new OleDbConnection(strConnection); objConnection.Open(); // Set the SQL string strSQL = "INSERT INTO sis (fname, lname) VALUES ( a , b)"; // Create the Command and set its properties objCmd = new OleDbCommand(strSQL, objConnection); // here our ionsert query will execute and insertour data in the database. objCmd.ExecuteNonQuery(); objConnection.Close(); } } Mazhar Hussain
-
help in windows serviceshi i add you on my msn messenger ... and i am waiting for you to come online and have a chat with you on it ... Maz Mazhar Hussain
-
help in c# web servicehi i am trying to make a simple web application using web services with c# web matrix i have get the data from html page and i can print it on my aspx page but i could not be able to pass my data to my web services in my web services i want to send my data in access database we i show you my code as under that i used ... this is my html code
First Name:
Last Name:
this is my aspx page code <%@ Page Language="C#" Debug=true %> void Page_Load(object src,EventArgs e) { String fn,ln; fn = Request.Form.Get("fname"); ln=Request.Form.Get("lname"); Response.Write("Your First Name is = " +"<b>" +fn +"</b>" +"<br>"); Response.Write("Your Last Name is = " +"<b>" +ln +"</b>" +"<br>"); } and this is my web services code <%@ WebService language="C#" Debug="True" class="my" %> using System; using System.Web.Services; using System.Xml.Serialization; public class my { [WebMethod] public void Add(string a, string b) { OleDbConnection objConnection = null; OleDbCommand objCmd = null; string strConnection, strSQL; strConnection = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\t1.mdb"); // Create and open the connection object objConnection = new OleDbConnection(strConnection); objConnection.Open(); // Set the SQL string strSQL = "INSERT INTO sis (fname, lname) VALUES ( a , b)"; // Create the Command and set its properties objCmd = new OleDbCommand(strSQL, objConnection); // here our ionsert query will execute and insertour data in the database. objCmd.ExecuteNonQuery(); objConnection.Close(); } } Mazhar Hussain
-
help in windows servicesHi i have make an windows services in c# ... the code is running ok ... there is no error in that .... in my code i am trying to hook the keyboard and save all the pressed keys in a txt file ... on services start it has to make a txt file and when the service stop it has to make one more txt file but on start it is not meaking any file but on stop it is meaking a file ... i don't know what is the problem with it ... i can send you my code if you can solve my this problem ... ok seea byee waiting for a flash reply ... Maz.:-O Mazhar Hussain
-
Help in ADSIHi i am working with ADSI with win 2003 server in c# ... i am trying to make a user the member of a group named "Administrators" ... my user is in an ou named "test2" ... when i start the program ... in the end when it should add the user in Admiistrators group it give me this error "System.Runtime.InteropServices.COMException(0x8004005): Unspecified error" my code is as under... it is on a button click. private void button5_Click(object sender, System.EventArgs e) { try { DirectoryEntry dom = new DirectoryEntry("LDAP://CN=Builtin,DC=jacal99,DC=com"); DirectoryEntry group = dom.Children.Find("CN=Administrators"); MessageBox.Show("group found"); DirectoryEntry dom2 = new DirectoryEntry("LDAP://OU=test2,DC=jacal99,DC=com"); DirectoryEntry usr = dom2.Children.Find("CN=lucky"); MessageBox.Show("user found"); group.Properties["Member"].Add(new string[] {"lucky"}); group.CommitChanges(); MessageBox.Show("user added :)"); } catch (Exception ex) { MessageBox.Show("error coz " + ex); } } ok waiting for the answer ... seea TC bye. Mazhar Hussain
-
Problem in response.getwhen this page run on "Page_Load" it does not get the user id from Login_page.aspx i put the try catch but there is no error. <%@ Page Language="C#" Debug="True" %> void Page_Load(Object sender, EventArgs e) { string name1; name1=Request.Form.Get("txtuser"); try { Response.Write("your login id is = " + name1); } catch (Exception ex) { Response.Write("your error is " +ex); } } Mazhar Hussain
-
need experts helpHi well as you say that it can be done by using winInet.dll ... i agree with you .... but i forgot to tell you that i am working in c# ... and can i get the same method in c#.... one more thing that is one of my friend tell me that you can do this by broadcasting ip address.... well what you say about this ....? Mazhar Hussain
-
need experts helpHi well i am meaking a software .... and i want to send an email through it ... yes i know the code to send an email ... but how can my software know's that weather the computer is connected with the internet ... because it will send email automactily after 5 minutes ... soo my question is that how my software know's that weather the computer is connected with internet... Best Regaurds. Mazhar Hussain
-
how can i expire the pageThanks Albert soo nice of you ... please connect with me for my next questions and help me out... thanks again. Mazhar Hussain
-
how can i expire the pageHi i need some help .... i want to expire my page or session abdon after 2 minutes... if the user has not tuch any link on the page that page expired after 2 minutes... if some one has any tutorial link regaurding to this or what method i can use then please tell me. :) Mazhar Hussain
-
access login complete<%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DataSource = d:\\access1.mdb"); //oledbCon.Open(); } void login_check(Object sender, EventArgs e) { string uid = txtuser.Text; string upass = txtpass.Text; string strCon = @"Data Source='D:\access1.mdb';Provider='Microsoft.Jet.OLEDB.4.0'"; //"Provider = Microsoft.Jet.OleDb.4.0; Data Source = d:\\access1.mdb" OleDbConnection oledbCon = new OleDbConnection(strCon); OleDbCommand oledbCom = new OleDbCommand("Select fname from users where username = '"+uid+"' and upassword = '"+upass+"' ", oledbCon); oledbCon.Open(); OleDbDataReader dr = oledbCom.ExecuteReader(); if(dr.Read()) { Response.Write("You are logged in"); oledbCon.Close(); string url = Request.QueryString["ReturnUrl"]; if(url==null) url = "main.aspx"; Response.Redirect(url); } else { Response.Write("Your Login Faild Try to Register and then login"); } }
Access Login
Username:
Password:
Mazhar Hussain
-
edit and update complete<%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { //OleDbConnection oledbcon = new OleDbConnection("Provider = Microsoft.Jet.Oledb.4.0; Data Source=d:\\access1.mdb"); if(!IsPostBack) BindGrid(); } public void dg_Edit(Object sender, DataGridCommandEventArgs e) { dg.Columns[0].HeaderText="Edit"; dg.EditItemIndex = (int)e.Item.ItemIndex; BindGrid(); } public void dg_Cancel(Object sender, DataGridCommandEventArgs e) { dg.Columns[0].HeaderText="Cancel"; dg.EditItemIndex = -1; BindGrid(); } public void dg_Update(Object sender, DataGridCommandEventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.Oledb.4.0; Data Source=d:\\access1.mdb"); dg.Columns[0].HeaderText="Update"; string userId = ((TextBox)e.Item.Cells[1].Controls[0]).Text; string updateCmd = "Update users set upassword = @password, fname = @fname, lname = @lname, address = @address WHERE username = '"+ userId + "'"; //string updateCmd = "Update users set upassword = @password, fname = @fname, lname = @lname, address = @address WHERE username = @uid"; OleDbCommand OleDbCom = new OleDbCommand(updateCmd, oledbCon); //OleDbCom.Parameters.Add(new OleDbParameter("@uid",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@password",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@fname",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@lname",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@address",OleDbType.VarChar, 50)); //OleDbCom.Parameters["@uid"].Value=((TextBox)e.Item.Cells[1].Controls[0]).Text; OleDbCom.Parameters["@password"].Value=((TextBox)e.Item.Cells[2].Controls[0]).Text; OleDbCom.Parameters["@fname"].Value=((TextBox)e.Item.Cells[3].Controls[0]).Text; OleDbCom.Parameters["@lname"].Value=((TextBox)e.Item.Cells[4].Controls[0]).Text; OleDbCom.Parameters["@address"].Value=((TextBox)e.Item.Cells[5].Controls[0]).Text; try { Response.Write(OleDbCom.CommandText); Response.Write("<br>"); //Response.Write("<br>uid = " + OleDbCom.Parameters["@uid"].Value); Response.Write("<br>password = " + OleDbCom.Parameters["</x-turndown>
-
need help in access databaseno i am using asp webmatrix tool. Mazhar Hussain
-
need help in edit & update access databasemy all code is running fine, but when i click on the update link ... it does not update the record :doh: ... need professional:cool: help on this because the compiler did't show me any error ... my all code is as under... ------------------------------------------------------- <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { OleDbConnection oledbcon = new OleDbConnection("Provider = Microsoft.Jet.Oledb.4.0; Data Source=d:\\access1.mdb"); if(!IsPostBack) BindGrid(); } public void dg_Edit(Object sender, DataGridCommandEventArgs e) { dg.Columns[0].HeaderText="Edit"; dg.EditItemIndex = (int)e.Item.ItemIndex; BindGrid(); } public void dg_Cancel(Object sender, DataGridCommandEventArgs e) { dg.Columns[0].HeaderText="Cancel"; dg.EditItemIndex = -1; BindGrid(); } public void dg_Update(Object sender, DataGridCommandEventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.Oledb.4.0; Data Source=d:\\access1.mdb"); dg.Columns[0].HeaderText="Update"; string updateCmd = "Update users set upassword = @password, fname = @fname, lname = @lname, address = @address WHERE username = @uid"; OleDbCommand OleDbCom = new OleDbCommand(updateCmd, oledbCon); OleDbCom.Parameters.Add(new OleDbParameter("@uid",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@password",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@fname",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@lname",OleDbType.VarChar, 50)); OleDbCom.Parameters.Add(new OleDbParameter("@address",OleDbType.VarChar, 50)); OleDbCom.Parameters["@uid"].Value=((TextBox)e.Item.Cells[1].Controls[0]).Text; OleDbCom.Parameters["@password"].Value=((TextBox)e.Item.Cells[2].Controls[0]).Text; OleDbCom.Parameters["@fname"].Value=((TextBox)e.Item.Cells[3].Controls[0]).Text; OleDbCom.Parameters["@lname"].Value=((TextBox)e.Item.Cells[4].Controls[0]).Text; OleDbCom.Parameters["@address"].Value=((TextBox)e.Item.Cells[5].Controls[0]).Text; OleDbCom.Connection.Open(); try { OleDbCom.ExecuteNonQue</x-turndown>
-
need help in access databasei have some problem in to check loging in access database. i am getting this error as under ------------------- Exception Details: System.Data.OleDb.OleDbException: Could not find installable ISAM. -------------------- the line of error is this ---------------- oledbCon.Open(); ---------------- my all code is as under ------------------------- <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DataSource = d:\\access1.mdb"); oledbCon.Open(); } void login_check(Object sender, EventArgs e) { string uid = txtuser.Text; string upass = txtpass.Text; OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DataSource = d:\\access1.mdb"); OleDbCommand oledbCom = new OleDbCommand("Select fname from users where username = '"+uid+"' and upassword = '"+upass+"' ", oledbCon); //oledbCon.Open(); OleDbDataReader dr = oledbCom.ExecuteReader(); if(dr.Read()) { Response.Write("You are logged in"); string url = Request.QueryString["ReturnUrl"]; if(url==null) url = "main.aspx"; Response.Redirect(url); } else { Response.Write("Your Login Faild Try to Register and then login"); } }
Access Login
Username:
Password: