|
Thanks for your quick reply.
It does make sense.
Sarfarj Ahmed
|
|
|
|
|
But
Just think abuot CodeProject.com
I can logged in from anywhere on this site.
Is their anything I can do:
After Logged In page will be redirect to previous page
Example:
If i click login btn from product.aspx then login.aspx will come. After logged in page will be redirect to product.aspx
waiting for your reply
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
Do it now. You'll see that CP does exactly what I was talking about. It redirects to the login page and passes to the login page, the page to go back to, on the URL. So, once you login, it reads that value and navigates back to that page.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanks a lot
i will let you know my result
Sarfarj Ahmed
|
|
|
|
|
Hi mates,
Need help again. About adding textbox value in gridview footer template, would it be possible? How will i do that? Note: The textbox value is come from the maxid of sql query. When the gridview page will load, it should have initial value one of the textbox.
<ItemTemplate>
<asp:Label ID="lblUserId" Text='<%# Eval("UserID") %>' runat="server"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblUserId" Text='<%# Eval("UserID") %>' runat="server"></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtUserId" Text='' runat="server"></asp:TextBox>
</FooterTemplate>
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Hi....I have two drop-down List boxes.How to update one drop-down list box based on values of other drop-down list..
E.g: Drop-down list 1 contains cars like Toyota,Hyundai etc...
If Toyota is Selected
(drop-down list 2 it must be updated with models of Toyota)
else Hyundai is selected
(drop-down list 2 must be updated with models of Hyundai)
All these data must be taken from SQL server
I am able to display the drop-down list 1 but i am not sure how to display only corresponding models of the selected Make(drop-down list1)
|
|
|
|
|
Why is this asked so often when it's so trivial ?
1 - handle the changed event of the first list
2 - in the event, read the value, and use it to populate the second list
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I asked this because i am unable to pass the values.....can u provide me with an example....
I am not sure of how to pass the Make value to database inorder to get the Model.....
Give me one example
|
|
|
|
|
Well, typically, there is an id stored as a value for the first list, so you end up with something like
select * from model where makeID = @makeId
as a stored proc which you call using the id from the selected column.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
This can also be done with AJAX. You have the user-facing page, an AJAX script, and a dynamic page. The user's selection passes a value over an XmlHttp request to a dynamic page, the output is returned via XmlHttp, and the contents of the user-facing page are changed via Javascript. Check out this example which has samples of all three parts-
http://w3schools.com/ajax/ajax_database.asp[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
Sure - it's almost the canonical AJAX example. I was just trying not to confuse the guy tho.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
SQL Server Databse keeps order information.
I want to send an automatic email to customer if order has been placed.
Any Solution
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
Yeah, the solution would be to automatically send an email when the order is placed. Might want to do that somewhere around your insert statement in your code, since that's probably where the order is complete in your end.
|
|
|
|
|
Did you consider trying to write some code to do this ? I don't see what SQL Server has to do with it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
could you please give some instruction
Sarfarj Ahmed
|
|
|
|
|
|
Thank you very much, i will folloe your instruction.
Sarfarj Ahmed
|
|
|
|
|
is this query correct?
"INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')";
error is Incorrect syntax near the keyword 'Create'
|
|
|
|
|
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...) is the synatax from w3schools.com[^]
is Create your table name?
try putting insert into `create` (...) values(...)
example
INSERT INTO `Persons` (P_Id, LastName, FirstName)
VALUES (5, 'Tjessem', 'Jakob')
|
|
|
|
|
What is name, city, etc ? Where do they come from ? It looks to me like your database security is a nightmare.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
"Create" is a reserved word in MSSQL so it cannot be used as the name of a table. Here is a full list of reserved words:
http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx[^]
You should be able to insert into the table by quoting the table name like so:
INSERT INTO "Create" ...
Joe Ceresini
Network Engineer
jceresini@hostmysite.com
Hostmysite.com
modified on Monday, February 2, 2009 7:10 PM
|
|
|
|
|
I'm trying to display content from db, but i'm getting this error on my page
ExecuteReader requires an open and available Connection. The connection's current state is closed.
My code is this:
public partial class admin_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
GetPageData();
}
private void GetPageData()
{
DBConnection obj = new DBConnection();
SqlDataReader reader;
DataTable dt = new DataTable();
string query = string.Empty;
try
{
query = "select * from menus order by name";
reader = obj.ExecuteRecordSet(query);
dt.Load(reader);
}
catch (Exception ex)
{
errlbl.Text = ex.Message.ToString();
}
finally
{
obj.CloseConnection();
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void lkAdd_Click(object sender, EventArgs e)
{
Response.Redirect("addmenus.aspx");
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GetPageData();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string query = "delete from menus where id=" + GridView1.DataKeys[e.RowIndex].Value.ToString();
DBConnection obj = new DBConnection();
try
{
obj.ExecuteSql(query);
}
catch (Exception ex)
{
}
GetPageData();
}
}
|
|
|
|
|
Sure would be nice for you to just post the pertinent code, or point out what line has the issue
DBConnection obj = new DBConnection();
SqlDataReader reader;
DataTable dt = new DataTable();
string query = string.Empty;
try
{
query = "select * from menus order by name";
reader = obj.ExecuteRecordSet(query);
dt.Load(reader);
So, obj is a DBConnection. What is that ? A custom class ? Where does it say that you specified a database to connect to, and connected to it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|