hey there, I'm still learning C# and am having some issues with a login I've created. The login page gets the user info into an object and sets the cookie no problem. But when I go to the next page I can't seem to figure out how to get at the object I created on the login page. Here's a snippet of what I've got...
privatevoid cmdLogin_ServerClick(object sender, System.EventArgs e)
UserDetails oUserDetails = validateUser(txtAssocNum.Value, txtUserName.Value, txtUserPass.Value);
if (oUserDetails != null)
//UserDetails oUserDetails = new UserDetails();
Response.Cookies["UserID"].Path = "/";
Response.Cookies["UserID"].Value = oUserDetails.UserID.ToString();
//oUserDetails = null;
lblMsg.Text = "The information you provided does not match our database.";
There are ways, but they're neither fancy nor are they new.
I suggest that you google Asp.net request.querystring Asp.net session Asp.net Page State
for the most common methods to pass data between pages.
I've been grappling with this for a few days now, and am no further forward, here's the scenario:
I have a page that contains the following
linqDataSource : productListDS (Selects * from products table)
GridView : gridProductList (Data source is productListDS)
linqDataSource : productDetailDS (Selects * from products table where id == id)
DetailsView : detailsProduct (Data source is productDetailDS)
The gridview lists all the products in the data source, with paging and select button enabled, when the select command is clicked the details view is then updated to show all the fields of the selected product and has the 'Edit', 'Insert' and 'Delete' commands enabled.
The gridView ONLY shows 5 columns from it's data source (The AutoGenerateColumns option is false) and i'm constructing the colums manually in the columns tag. I have the DataKeys set to id, and when i click the select button everything works flawlessly.
My problem comes when i do an Insert/Delete/Update.
As an example if i add a new record by putting the details form into insert mode, fill in the fields and then click insert, it inserts the record into the underlying SQLServer database, but the gridview does not update.
I've tried doing a 'gridProductList.DataBind()' in the page load, and in the details view 'ItemInserted' event, and still no luck. If however i browse away from the page, and then back the gridView then displays the newly added products. Even pressing F5 to force an update does not work, in fact all that achieves is to resubmit the last insert and add another new record to the DB.
The linq Data SOurce is connected to a LInqToSql DBML class.
Does anyone have ANY ideas on how to force the Grid View to update and show the table changes made using the details view without having to browse away from the page and then browse back.
Does ths even apply when i'm not doing the original databinding manually, i'm just letting the datasource/datagrid sort it out them selves. Calling the DataBind() proc just seemed like a sensible thing to try to force it to update.
I think the most common thing is this. Someone creates a website within visual studio and so the security on the directory is handled for you. Then you move the directory to someother location for deployment and it doesn't work. Typically this is because the service that is running doesn't have proper access to the new directory. However, it would be more helpful if you shut of friendly error messages and posted what the exact error is that your getting.
I gave the stored procedure for a sql adapter(database1) and in the select command i selecedt stored procedure ..
I have other adapter(database2) in tat i gave the update stored procedure for same table.
can i do the code like this
take that dataset and update to other sqladapter 2
wether it will work?
or any other idea or easy way to insert a table datas from one db to other db table ..
pls help me
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-23 20:08