RE: CANT see EDIT UPDATE CANCEL Buttons for DATAGRID

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: pmud (pmud_at_discussions.microsoft.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 08:07:04 -0800

Hi Gregory,

For updating the SQL database using data grid , is primary key required? I
dont have a primary key in the SQl table. Is it possible to do the same
thing if I dont want to make a primary key ???

"Cowboy (Gregory A. Beamer) - MVP" wrote:

> Yes, your idea is likely. Move the code that fills the dataset to its own
> routine and call from the button click. Call again from the EDIT postback
> routine just prior to asking for a particular edit column. If not, you will
> get either a) nothing or b) whatever is "cached" in viewstate.
>
>
> ---
>
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
> "pmud" wrote:
>
> > Hi,
> >
> > I have an ASP.NET application using C# code. I am using a datagrid to
> > display records from a database based on a user input, i.e a user enters a
> > compnay name in text box & when he clicks a "Submit" button, only those
> > records are displayed where company name matches with user input.
> >
> > I need the datagrid to be editable. For this i used the walkthrough from
> > .NET "Using a datagrid for reading & writing data to database" or it was some
> > similar name.
> > This code works fine when the datagrid shows all records but for the data
> > grid which shows only the records based on user input, this walkthrough
> > doesnt work. I think its bcoz i fill the dataset on "Submit" button click
> > rather than on page load. So when I hit the submit button after entering
> > Company name, I get to view records of that company. But WHEN I HIT the EDIT
> > LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
> > ONLY see those buttons when I hit submit again!!!
> >
> > How to get over this?
> >
> > --
> > pmud



Relevant Pages

  • RE: creating a new database
    ... if i dont link them to the courses and costs, how would we need what have ... ---CourseID Autonumber Primary Key ...
    (microsoft.public.access.modulesdaovba)
  • Re: Coding at table with multiple primary key columns
    ... Hey Andi, this solution does not work I am getting a Constraint error. ... I dont know if that makes a difference. ... the unique contraint do the same thing as the primary key. ...
    (microsoft.public.access.modulesdaovba)
  • Re: DataGrid - retaining colours when re-ordering
    ... I set the back color of the second row in my data grid view to the red ... private void Form1_Load(object sender, EventArgs e) ... // add the value of the primary key to the collection keylist ...
    (microsoft.public.dotnet.general)
  • Re: Clustered columns confusion
    ... "Chinmay" wrote in message ... > Yes and i dont have a Primary Key on Image column. ...
    (microsoft.public.sqlserver.server)
  • Re: Access 2K3, SQL Server 2K5, "Instead of" Trigger Problem
    ... why dont you just use a simple integer as a PK ... and then you can take your extra special PK and shove it wherever you ... Sylvain Lafontaine ... the primary key of the primary table if the new row has a null value ...
    (microsoft.public.access.adp.sqlserver)