Showing posts with label displays. Show all posts
Showing posts with label displays. Show all posts

Monday, March 19, 2012

Need report to NEVER cache

Let me say up front that rs:ClearSession=true didn't work :)

I have a report on RS that displays two blocks of data. The intent is to move items from one list to the other. To do so, there's a link on the detail lines which does a drill-through to another report. That report takes parameters (IDs for the record to be moved) and uses a stored procedure as it's datasource. The stored procedure takes in the parameter, does an INSERT INTO into the table that's driving which list items appear on, then returns the ID that was affected. On the report, there's just a text box stating that the item was added to the table and a "Back" text box. This Back item is a drill through back to the original report.

When we go back to the report (not really *back* since we're actually drilling through to the report anew), I want it to show the two lists with the one item moved from the one list to the other. Problem is, since the report was already run, it's showing the data from the cache. If I hit the refresh button, it updates and the item moves as it should.

I've read a number of posting on this and the only thing anyone said that should work was to use the rs:ClearSession=true option in the URL. So I generated a URL to the report, added this option. Tested that my URL worked and then changed the "Back" text box's navigation so that rather than a simple drill-through, it goes to a URL...the one with the ClearSession.

But it still doesn't work. I click the link on one of my lines, it goes to the drill through saying that it added the line to the table (I can even query the table in QA and see that it did), then I click the Back and I can see in the address box that the ClearSession arguement is there but the results still don't refresh.

I've also tried CTRL-F5 while in this state and the data doesn't refresh. The only thing that makes it re-run the stored procedure and pull in new data is the green refresh button.

Any ideas?

Thanks, Tim

Does the original report have a query parameter? If it does, the original query should be re-executed. You might need to bind it to a complext expression (not just =Parameters!XX.Value).|||

Brian,

The report has two data sets that are based on Stored Procedures. The sproc does have parameters but the only parameters being passed is a @.MODE that allows the sproc to run different blocks of code (let me know if you'd like to see the code of the sproc.

So there's nothing dynamic about what's being passed in, it's always the same. I tried adding a parameter called @.CURR_TIME to test what I thought you were saying. I set the dataset to pass "=Now()" to that parameter. Within the code of the sproc, the parameter is then ignored. In theory, everytime it's called, it would think it needs to send the sproc a new time, right? But still, when I drill through back to the parent report, it doesn't rerun. I hit the refresh and the data changes show up.

Help!!! :(

Tim

|||

Can anyone elaborate on what Brian was saying? I really need to get this report to always rerun the sproc behind it every time it refreshes through any means and Brian sounded like he knew how to do that.

Thanks,

Tim

|||

I'd still love to hear if anyone can elaborate on this. I didn't quite understand how to do what Brian was referring to.

Thanks,

Tim

|||

Hi Tim,

I had the same issue. To get around it, we created a time parameter, similar to what you described on your stored procedure, but on the report itself. Always passing the current time will make the report completely re-execute.

-Jessica

|||

Jessica,

Thanks so much for the response. I was so focused on getting the sproc to rerun, it didn't occur to me to try forcing the report to refresh in that way! I added a parameter to the report called ENSURE_REFRESH with a prompt "Ingore this prompt:", made it a datetime type and gave it a default of =DateAdd("s", 1, Now()). It worked perfectly!!!!

Everytime I drill back to the report, it's realizes it needs to refresh because the default changes and the underlying data changes are reflected!!!!

Thanks for getting me thinking in the right direction.

Tim Graffham

Monday, March 12, 2012

Need report to NEVER cache

Let me say up front that rs:ClearSession=true didn't work :)

I have a report on RS that displays two blocks of data. The intent is to move items from one list to the other. To do so, there's a link on the detail lines which does a drill-through to another report. That report takes parameters (IDs for the record to be moved) and uses a stored procedure as it's datasource. The stored procedure takes in the parameter, does an INSERT INTO into the table that's driving which list items appear on, then returns the ID that was affected. On the report, there's just a text box stating that the item was added to the table and a "Back" text box. This Back item is a drill through back to the original report.

When we go back to the report (not really *back* since we're actually drilling through to the report anew), I want it to show the two lists with the one item moved from the one list to the other. Problem is, since the report was already run, it's showing the data from the cache. If I hit the refresh button, it updates and the item moves as it should.

I've read a number of posting on this and the only thing anyone said that should work was to use the rs:ClearSession=true option in the URL. So I generated a URL to the report, added this option. Tested that my URL worked and then changed the "Back" text box's navigation so that rather than a simple drill-through, it goes to a URL...the one with the ClearSession.

But it still doesn't work. I click the link on one of my lines, it goes to the drill through saying that it added the line to the table (I can even query the table in QA and see that it did), then I click the Back and I can see in the address box that the ClearSession arguement is there but the results still don't refresh.

I've also tried CTRL-F5 while in this state and the data doesn't refresh. The only thing that makes it re-run the stored procedure and pull in new data is the green refresh button.

Any ideas?

Thanks, Tim

Does the original report have a query parameter? If it does, the original query should be re-executed. You might need to bind it to a complext expression (not just =Parameters!XX.Value).|||

Brian,

The report has two data sets that are based on Stored Procedures. The sproc does have parameters but the only parameters being passed is a @.MODE that allows the sproc to run different blocks of code (let me know if you'd like to see the code of the sproc.

So there's nothing dynamic about what's being passed in, it's always the same. I tried adding a parameter called @.CURR_TIME to test what I thought you were saying. I set the dataset to pass "=Now()" to that parameter. Within the code of the sproc, the parameter is then ignored. In theory, everytime it's called, it would think it needs to send the sproc a new time, right? But still, when I drill through back to the parent report, it doesn't rerun. I hit the refresh and the data changes show up.

Help!!! :(

Tim

|||

Can anyone elaborate on what Brian was saying? I really need to get this report to always rerun the sproc behind it every time it refreshes through any means and Brian sounded like he knew how to do that.

Thanks,

Tim

|||

I'd still love to hear if anyone can elaborate on this. I didn't quite understand how to do what Brian was referring to.

Thanks,

Tim

|||

Hi Tim,

I had the same issue. To get around it, we created a time parameter, similar to what you described on your stored procedure, but on the report itself. Always passing the current time will make the report completely re-execute.

-Jessica

|||

Jessica,

Thanks so much for the response. I was so focused on getting the sproc to rerun, it didn't occur to me to try forcing the report to refresh in that way! I added a parameter to the report called ENSURE_REFRESH with a prompt "Ingore this prompt:", made it a datetime type and gave it a default of =DateAdd("s", 1, Now()). It worked perfectly!!!!

Everytime I drill back to the report, it's realizes it needs to refresh because the default changes and the underlying data changes are reflected!!!!

Thanks for getting me thinking in the right direction.

Tim Graffham

Need report to NEVER cache

Let me say up front that rs:ClearSession=true didn't work :)

I have a report on RS that displays two blocks of data. The intent is to move items from one list to the other. To do so, there's a link on the detail lines which does a drill-through to another report. That report takes parameters (IDs for the record to be moved) and uses a stored procedure as it's datasource. The stored procedure takes in the parameter, does an INSERT INTO into the table that's driving which list items appear on, then returns the ID that was affected. On the report, there's just a text box stating that the item was added to the table and a "Back" text box. This Back item is a drill through back to the original report.

When we go back to the report (not really *back* since we're actually drilling through to the report anew), I want it to show the two lists with the one item moved from the one list to the other. Problem is, since the report was already run, it's showing the data from the cache. If I hit the refresh button, it updates and the item moves as it should.

I've read a number of posting on this and the only thing anyone said that should work was to use the rs:ClearSession=true option in the URL. So I generated a URL to the report, added this option. Tested that my URL worked and then changed the "Back" text box's navigation so that rather than a simple drill-through, it goes to a URL...the one with the ClearSession.

But it still doesn't work. I click the link on one of my lines, it goes to the drill through saying that it added the line to the table (I can even query the table in QA and see that it did), then I click the Back and I can see in the address box that the ClearSession arguement is there but the results still don't refresh.

I've also tried CTRL-F5 while in this state and the data doesn't refresh. The only thing that makes it re-run the stored procedure and pull in new data is the green refresh button.

Any ideas?

Thanks, Tim

Does the original report have a query parameter? If it does, the original query should be re-executed. You might need to bind it to a complext expression (not just =Parameters!XX.Value).|||

Brian,

The report has two data sets that are based on Stored Procedures. The sproc does have parameters but the only parameters being passed is a @.MODE that allows the sproc to run different blocks of code (let me know if you'd like to see the code of the sproc.

So there's nothing dynamic about what's being passed in, it's always the same. I tried adding a parameter called @.CURR_TIME to test what I thought you were saying. I set the dataset to pass "=Now()" to that parameter. Within the code of the sproc, the parameter is then ignored. In theory, everytime it's called, it would think it needs to send the sproc a new time, right? But still, when I drill through back to the parent report, it doesn't rerun. I hit the refresh and the data changes show up.

Help!!! :(

Tim

|||

Can anyone elaborate on what Brian was saying? I really need to get this report to always rerun the sproc behind it every time it refreshes through any means and Brian sounded like he knew how to do that.

Thanks,

Tim

|||

I'd still love to hear if anyone can elaborate on this. I didn't quite understand how to do what Brian was referring to.

Thanks,

Tim

|||

Hi Tim,

I had the same issue. To get around it, we created a time parameter, similar to what you described on your stored procedure, but on the report itself. Always passing the current time will make the report completely re-execute.

-Jessica

|||

Jessica,

Thanks so much for the response. I was so focused on getting the sproc to rerun, it didn't occur to me to try forcing the report to refresh in that way! I added a parameter to the report called ENSURE_REFRESH with a prompt "Ingore this prompt:", made it a datetime type and gave it a default of =DateAdd("s", 1, Now()). It worked perfectly!!!!

Everytime I drill back to the report, it's realizes it needs to refresh because the default changes and the underlying data changes are reflected!!!!

Thanks for getting me thinking in the right direction.

Tim Graffham

Friday, March 9, 2012

Need more table rows displayed on page

Right now I have a report with groupings and each full set takes up quite a
bit of room. So right now it only displays 10 sets per page, but I'd like to
increase this to 30. How can I make a table display more information before
making a new page?Change the page size... It is in the report properties menu item...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"scraejtp" <scraejtp@.discussions.microsoft.com> wrote in message
news:AF670A51-C85B-43AB-89E6-10323C8D2950@.microsoft.com...
> Right now I have a report with groupings and each full set takes up quite
> a
> bit of room. So right now it only displays 10 sets per page, but I'd like
> to
> increase this to 30. How can I make a table display more information
> before
> making a new page?|||Thanks, ended up being a small fix. I'd rather there be some type of exact
number since now it can differ from page to page since some entries are
larger/smaller, but this works fine.
"Wayne Snyder" wrote:
> Change the page size... It is in the report properties menu item...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "scraejtp" <scraejtp@.discussions.microsoft.com> wrote in message
> news:AF670A51-C85B-43AB-89E6-10323C8D2950@.microsoft.com...
> > Right now I have a report with groupings and each full set takes up quite
> > a
> > bit of room. So right now it only displays 10 sets per page, but I'd like
> > to
> > increase this to 30. How can I make a table display more information
> > before
> > making a new page?
>
>|||I have an example on www.msbicentral in the RDL Downloads section which
shows how to set a fixed number of rows/page to display... Its not very
hard...The filename is PagedTableParameters.RDL
Hope this helps
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"scraejtp" <scraejtp@.discussions.microsoft.com> wrote in message
news:F9921495-BF23-42A9-ADB6-AB5FB3319188@.microsoft.com...
> Thanks, ended up being a small fix. I'd rather there be some type of exact
> number since now it can differ from page to page since some entries are
> larger/smaller, but this works fine.
> "Wayne Snyder" wrote:
>> Change the page size... It is in the report properties menu item...
>> --
>> Wayne Snyder, MCDBA, SQL Server MVP
>> Mariner, Charlotte, NC
>> www.mariner-usa.com
>> (Please respond only to the newsgroups.)
>> I support the Professional Association of SQL Server (PASS) and it's
>> community of SQL Server professionals.
>> www.sqlpass.org
>> "scraejtp" <scraejtp@.discussions.microsoft.com> wrote in message
>> news:AF670A51-C85B-43AB-89E6-10323C8D2950@.microsoft.com...
>> > Right now I have a report with groupings and each full set takes up
>> > quite
>> > a
>> > bit of room. So right now it only displays 10 sets per page, but I'd
>> > like
>> > to
>> > increase this to 30. How can I make a table display more information
>> > before
>> > making a new page?
>>

need matrix report advice

I have to create a report that displays monthly actual and forecasted values by project with a variance column for the current month. Has anyone ever attempted something like this? I am having a difficult time determining how the data should return from the procedure so that it can be display in the following format:

JUL

AUG

SEP

OCT

NOV

DEC

JAN

FEB

Actuals

Var

Forecast

PROJECT A

10

20

15

-15

30

15

41

26

47

64

PROJECT B

15

10

25

5

20

20

10

5

10

10

I need to use a matrix since the number of columns can vary. I have thought about returning the following fields: project, date, label, hours.

I am hoping someone has attempted this before and can offer advice on whether I am approaching the problem correctly.

Thanks for any help.

hey there

not sure if this is what you want but this is how I approached a similar report using a Matrix - with varying columns

Report was for a Weekly user worktime

put this in your layout view

(1)=(Parameters!PersonNameValue)

(2-across)=Fields!WorkDate.Value)

(3)=Fields!CallSubject3.Value

(4-across)=Format(Sum(Fields!WorkTime.Value)

(5)=Format(Sum(Field...hrs total)

(6) blank

this shows like below

person date1 date 2 etc

subject time time etc

total time totaltime totaltime etc

sorry I wasn't sure how to post a graphical view on here so I hope this helps you

just add extra fields as required

any questions please ask

Jewel

Monday, February 20, 2012

Need help with updating a gridview from code-behind

Hi,

I've got a gridview that displays some (but not all) columns from a sql database table. One of the columns that is NOT displayed is the table's primary key column. I'm putting together this row updating sub based on an article I found on the 'Net. Here's the code I've added for the GridView's edit routine (based on the article):

Protected Sub gvPersonnelType_RowEditing(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.GridViewEditEventArgs)Handles gvPersonnelType.RowEditinggvPersonnelType.EditIndex = e.NewEditIndexgvPersonnelTypeBindData()End SubProtected Sub gvPersonnelType_RowCancellingEdit(ByVal senderAs Object,ByVal eAs GridViewCancelEditEventArgs)gvPersonnelType.EditIndex = -1gvPersonnelTypeBindData()End SubProtected Sub gvPersonnelType_RowUpdating(ByVal senderAs Object,ByVal eAs GridViewUpdateEventArgs)'Dim PersonnelTypeID As Integer'This is not displayed in the gridview, but is the primary key in the databaseDim LaborForceTypeIDAs IntegerDim DefaultPayRate, DefaultPieceRate, RebillAs Decimal'These are money datatype in the databaseDim DefaultAdminCostPercent, MarkUpAs Double'These are float datatype in the database
'Don't know if the following lines properly "capture" the values in the textboxesLaborForceTypeID =Integer.Parse(gvPersonnelType.Rows(e.RowIndex).Cells(0).Text)DefaultPayRate =CType(gvPersonnelType.Rows(e.RowIndex).Cells(1).Controls(0), TextBox).TextDefaultPieceRate =CType(gvPersonnelType.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).TextDefaultAdminCostPercent =CType(gvPersonnelType.Rows(e.RowIndex).Cells(3).Controls(0), TextBox).TextRebill =CType(gvPersonnelType.Rows(e.RowIndex).Cells(4).Controls(0), TextBox).TextMarkUp =CType(gvPersonnelType.Rows(e.RowIndex).Cells(5).Controls(0), TextBox).TextDim gvSqlConn =New SqlConnection("DATABASECONNECTION")gvSqlConn.open()Dim UpdatePersonnelTypeCmdAs New SqlCommand("UPDATE rsrc_PersonnelType SET LaborForceTypeID = @.LaborForceTypeID, " & _"DefaultPayRate = @.DefaultPayRate, DefaultPieceRate = @.DefaultPieceRate, " & _"DefaultAdminCostPercent = @.DefaultAdminCostPercent, Rebill = @.Rebill, Markup = @.Markup", gvSqlConn)'Sql doesn't know what row to update: NEED WHERE STATEMENT!!!UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.LaborForceTypeID", LaborForceTypeID))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultPayRate", DefaultPayRate))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultPieceRate", DefaultPieceRate))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultAdminCostPercent", DefaultAdminCostPercent))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.Rebill", Rebill))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.Markup", MarkUp))UpdatePersonnelTypeCmd.ExecuteNonQuery()gvSqlConn.close()gvPersonnelType.EditIndex = -1gvPersonnelTypeBindData()End Sub

As you can see, I've added some notes in the RowUpdating sub. I don't understand how to use the PersonnelTypeID (the database table's primary key) for the WHERE clause to update the correct row in the database.

As for the GridView itself, it's populated from the code-behind as well (as you can see from the call to "gvPersonnelTypeBindData()") and the SELECT statement used to populate the gridview doesn't use the PersonnelTypeID column either.

I'd appreciate it if someone could point me in the right direction to get this RowUpdating sub working.

Thanks!

Check out DataKeys property of GridView. If data key column is known then in your update method you can ask object id = gridView.DataKeys[e.RowIndex].Value;|||

Hey, DigiMortal. Thanks for replying.

Well, can I just set the DataKeyName property of the Gridivew on the aspx side to the table's primary key column? That doesn't seem to me (in my limited experience, mind you) that doing that would work, would it? I'm skeptical of that only because the primary key column isn't in the SELECT statement, either, so the GridView (and, hence any related changes to the data it displays) isn't really "aware" of the primary key column anyway, is it?

Looking at that code snippet you posted, (I work in VB, so it's "Dim id As Object = gridView.DataKeys(e.RowIndex).Value"), I'm not sure I understand how to implement that into my code. If my primary key (and hence the DataKeyName) is PersonnelTypeID, then would that line be: "Dim PersonnelTypeID As Object = gridView.DataKeys(e.RowIndex).Value"?

Obviously, I'm a bit confused. Could you clarify some?

Thanks!

|||

That would be correct. You need to add the PrimaryKey column to your select list as well.

Then the where clause would be:

WHEREPrimaryKeyField=@.PK

Then add the PK value like:

UpdatePersonnelTypeCmd.Parameters.Add("@.PK",SqlDbType.Int).Value=e.Keys(0)

or

UpdatePersonnelTypeCmd.Parameters.Add("@.PK",SqlDbType.Int).Value=Gridview1.Datakeys(e.RowIndex).Value

|||

Hey, Motley, thanks for piping in.

I did get somewhere on my sub yesterday, but can't tell if I'm getting it right due to another issue going on.

What I did was this:

Dim PersonnelTypeIDAs Object = gvPersonnelType.DataKeys(e.RowIndex).Value'Connection info here...Dim UpdatePersonnelTypeCmdAs New SqlCommand("UPDATE table SET column1 = @.parameter1, " & _" column2 = @.parameter2... WHERE PersonnelTypeID = " & PersonnelTypeID, gvSqlConn)'Then I went and added my sql parameters:UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.parameter1", column1))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.parameter2", column2))'Write to the database table...'Note no mention of the PersonnelTypeID (the PK) other than the first line

But in your (Motley's) post you add the PK field in the parameters, which makes more sense to me than the way I did it. Or did I essentially do that in the first "Dim" line in my code above?

Either way, I can't find out if this is working or not, because I've got another issue going on in this sub as well:

If I leave a textbox empty and click the "Update" link in the GridView, the program errors on this line:

DefaultPieceRate =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditDefaultPieceRate"), TextBox).Text

Default Piece Rate is a money datatype in the database table and the error reads: "InvalidCastException was unhandled by user code. Conversion from string "" to type 'Decimal' is not valid. When casting from a number, the value must be a number less than infinity."

Obviously, it's becuase the textbox is empty that it's trying to convert "" to decimal. I can have empty textboxes in my INSERT sub and that works, but I'm not quite sure how to allow for empty textboxes in this context.

Could I get some help ironing out this problem so I can get back to the original, PK parameter issue ?

Thanks!

|||

Okay, I got everything working in this sub now! I'll post the working version below, so anyone having the same problem can compare and see how I solved it.

I know this turned out to be a long post, but I learned a lot working on these two issues, so hopefully I can save someone else's time and pain by providing the lessons I learned...

As far as the PK issue, that was a matter of setting the DataKeyNames property of the GridView on the aspx side (I suppose you could do it from the code-behind) to the PK column name. Then I instantiated it as such:

Dim PersonnelTypeIDAs Object = gvPersonnelType.DataKeys(e.RowIndex).Value

Then I simply used that in my UPDATE statement in the where clause:

 ...WHERE PersonnelTypeID = @.PersonnelTypeID"

And since it's a parameter, as Motley suggested in his post, I added this line to my parameters section:

UpdatePersonnelTypeCmd.Parameters.Add("@.PersonnelTypeID", SqlDbType.Int).Value = gvPersonnelType.DataKeys(e.RowIndex).Value

Viola! I have my PK to update my table. Oh, yeah. The PK column has to be in the SELECT statement as well (I know, that's obvious to a lot of people, but I'm still learning and I know there are plenty of other noobs reading these posts, as well).

Then there's the other issue, I was getting an error on blank textboxes. That was solved quite simply by CASTing the offending parameter to the database table's corresponding datatype:

UPDATE tableNameSET column1 = @.parameter1, column2 =CAST(@.parameter2AS money), ...

So, here's the complete working sub:

Protected Sub gvPersonnelType_RowUpdating(ByVal senderAs Object,ByVal eAs GridViewUpdateEventArgs)Dim PersonnelTypeIDAs Object = gvPersonnelType.DataKeys(e.RowIndex).ValueDim LaborForceTypeIDAs IntegerDim DefaultPayRate, DefaultPieceRate, Rebill, DefaultAdminCostPercent, MarkUpAs StringLaborForceTypeID =CType(Me.gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditLaborForceTypeID"), TextBox).TextDefaultPayRate =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditDefaultPayRate"), TextBox).TextDefaultPieceRate =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditDefaultPieceRate"), TextBox).TextDefaultAdminCostPercent =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditDefaultAdminCostPct"), TextBox).TextRebill =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditRebill"), TextBox).TextMarkUp =CType(gvPersonnelType.Rows(e.RowIndex).FindControl("txtEditMarkUp"), TextBox).TextDim gvSqlConn =New SqlConnection("DATABASECONNECTION")Dim UpdatePersonnelTypeCmdAs New SqlCommand("UPDATE rsrc_PersonnelType SET LaborForceTypeID = @.LaborForceTypeID, " & _"DefaultPayRate = CAST(@.DefaultPayRate AS money), DefaultPieceRate = CAST(@.DefaultPieceRate AS money), " & _"DefaultAdminCostPercent = CAST(@.DefaultAdminCostPercent AS decimal), Rebill = CAST(@.Rebill AS money), " & _"Markup = CAST(@.Markup AS decimal) WHERE PersonnelTypeID = @.PersonnelTypeID", gvSqlConn)UpdatePersonnelTypeCmd.Parameters.Add("@.PersonnelTypeID", SqlDbType.Int).Value = gvPersonnelType.DataKeys(e.RowIndex).ValueUpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.LaborForceTypeID", LaborForceTypeID))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultPayRate", DefaultPayRate))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultPieceRate", DefaultPieceRate))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.DefaultAdminCostPercent", DefaultAdminCostPercent))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.Rebill", Rebill))UpdatePersonnelTypeCmd.Parameters.Add(New SqlParameter("@.Markup", MarkUp))Using gvSqlConn gvSqlConn.open()UpdatePersonnelTypeCmd.ExecuteNonQuery()gvSqlConn.close()End UsinggvPersonnelType.EditIndex = -1gvPersonnelType.PageIndex = 0gvPersonnelTypeBindData()End Sub

Hope that helps someone out there!

Cheers!

Now on to the next problem (it's a never-ending thing...)