problem on asp.net
hi everyone,presently i m working in asp.net.i want to retrive data like move
first last add jst like in a form,i have already done gridview list view and form view,if here anybody have done this type of coding then say me is it possible?
if yes then how?
first last add jst like in a form,i have already done gridview list view and form view,if here anybody have done this type of coding then say me is it possible?
if yes then how?
Replies
-
funmonster
Dude! I'm familiar with ASP.NET, but I didn't understand what you say. If you can elaborate I may help you.prabhat kumarhi everyone,presently i m working in asp.net.i want to retrive data like move
first last add jst like in a form,i have already done gridview list view and form view,if here anybody have done this type of coding then say me is it possible?
if yes then how? -
funmonster
Make sure the database connection is open till you your query is completely executed, As in the following example:HurstWhen I write code in ASP.NET to access the database...what can I do to avoid thisproblem. to the database server else there is a problem with username and password if the connection.
public partial class Login : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\.mdf;Integrated Security=True;User Instance=True");
protected void Button1_Click(object sender, EventArgs e)
{
String qry = "select username,password from registration where username=@username and password=@password";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.Parameters.Add("@username", SqlDbType.VarChar, 40).Value = UserName.Text;
cmd.Parameters.Add("@password", SqlDbType.VarChar, 40).Value = Password.Text;
con.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["uname"] = UserName.Text; //UserName is the ID of the text box field
Response.Redirect("SuccessfulLogin.aspx"); //Direct the control to user profile
}
else
{
Response.Redirect("Loginfailure.aspx"); //Direct the control to login failure page
}
con.Close();
}
} -
prabhat kumarthanks every one i got my solution...
-
funmonster
Please choose best solution or post it so that it may help some one in future..prabhat kumarthanks every one i got my solution...
You are reading an archived discussion.
Related Posts
I am facing problem in displaying blinking text in HTML.I know we have to use
tag
Please suggest me some book for Java script which includes every aspect of
this language in detail?
I am sure most of the computer science students must aware of these
Problems that are also known as Non Polynomial Problems .
Such Problems are those which can not...
I am a 2nd year student of Metallurgy and material science engineering in NIT Jamshedpur.I am looking for summer training in IITs or in NITs this year.Please help me informing...
Following is the list of top 25 questions asked last year in Google & Microsoft Interview; published by Glassdoor:
Let's try to answer them 😉
What was your best McGuyver...