Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Novice question on 'DetailsForm' and 'Grid'
Hi guys.

I have been thrown into the deep end. I don't know ASP, and with my C#
development, I haven't used data aware controls.

I am swimming OK so far (Image uploaded completed, XML/XSL menu
created for the Master Page) but now now I have been asked to create a
few screens that allow updating of small tables. Basically, you select
the category you want to end, and you're presented with a list of
names in that category. You click one in the menu, and are presented
with a 'GridView', which has 'Select' enabled.

Click Select, and a 'DetailsView' is displayed with an 'Edit' and
'Delete' button. The correct data from the selected row in the grid is
displayed.

Click 'Edit' and the fields become active. I edit. When I click
'Save', things go bad. It doesn't save. Now, my code is completely
wrong.. so it's not worth posting. But here it is anyway, to help you
underdtand how tangled I am:

Basically, the case tests for which 'category' is selected. The
'Select' works fine for all categories. The update fails. Actually,
the code below works, as I am hardcoding.

How do I get the UpdateParameter values from the DetailsView?

case "incidentcategory":
{
odsAdministrator.TypeName =
"DAL.Data.AdministratorDSTableAdapters.DTsortCategoryTypeTableAdapter";
odsAdministrator.SelectMethod =
"getCategoryTypeData";
odsAdministrator.SelectParameters.Add("ServiceId",
"4");
odsDetails.DataBind();


if (DetailsView1.SelectedValue != null)
{
odsDetails.UpdateParameters.Clear();
odsDetails.UpdateParameters.Add("Id",
DetailsView1.SelectedValue.ToString());
odsDetails.UpdateParameters.Add("ModifierId",
"1");
odsDetails.UpdateParameters.Add("Name",
"TEST!");
odsDetails.TypeName =
odsAdministrator.TypeName;
odsDetails.Update();
}

odsAdministrator.DataBind();
GridView1.DataBind();
DetailsView1.DataBind();
break;
}

How should I be doing this?

Report this thread to moderator Post Follow-up to this message
Old Post
info@listerhome.com
04-18-08 02:59 AM


Re: Novice question on 'DetailsForm' and 'Grid'
info@listerhome.com wrote:
> Hi guys.
>
> I have been thrown into the deep end. I don't know ASP, and with my C#
> development, I haven't used data aware controls.
>

There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic asp newsgroup. ASP.Net bears
very little resemblance to classic ASP so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
04-18-08 02:59 AM


Re: Novice question on 'DetailsForm' and 'Grid'
Thanks!
Sorry for the error.

Report this thread to moderator Post Follow-up to this message
Old Post
info@listerhome.com
04-18-08 02:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:04 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.