Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Friday, March 30, 2012

GROUPING SETS in What's New (Database Engine)

Just as a usability issue, most of the topics mentioned in the "What's New" documents have a link to further information. The GROUPING SETS item under "What's New in CTP 1" at /s10de_0evalplan/html/8f625d5a-763c-4440-97b8-4b823a6e2439.htm should contain a link to the GROUPING SETS topic. Of course, the GROUPING SETS entry in the index currently points to /s10de_6tsql/html/c1050658-b19f-42ee-9a05-ecd6a73b896c.htm which is actually the topic GROUPING_ID (Transact-SQL).

I realize that "What's New in CTP 1" will go away but I assume these groups of topics will be combined into a grander "What's New in SQL Server 2008" section distributed with RTM Books Online.

Hi Aaron,

Thanks for the good suggestions.

Regards,

Gail

GROUPING SETS in What's New (Database Engine)

Just as a usability issue, most of the topics mentioned in the "What's New" documents have a link to further information. The GROUPING SETS item under "What's New in CTP 1" at /s10de_0evalplan/html/8f625d5a-763c-4440-97b8-4b823a6e2439.htm should contain a link to the GROUPING SETS topic. Of course, the GROUPING SETS entry in the index currently points to /s10de_6tsql/html/c1050658-b19f-42ee-9a05-ecd6a73b896c.htm which is actually the topic GROUPING_ID (Transact-SQL).

I realize that "What's New in CTP 1" will go away but I assume these groups of topics will be combined into a grander "What's New in SQL Server 2008" section distributed with RTM Books Online.

Hi Aaron,

Thanks for the good suggestions.

Regards,

Gail

Wednesday, March 28, 2012

Grouping on one line

Okay...i haven't been able to find any answers to this question mostly
because i think its hard to search for. If someone can provide a link
to a website, that would be super. I have a report that is current
laid out, with grouping, like so
Header1
Header2.1
Header3
Details
Details
Details
Details
Header2.2
Header3
Details
Details
Details
Details
Does anyone know how to make it lay out like this...
Header1 Header2.1 Header3 Details
Details
Details
Details
Header2.2 Header3 Details
Details
Details
Details
I've played with some grouping, but it's not working.
Solutions/suggestionsI figured out my own problem, and i hope this will help others.
Keep the grouping, but remove the headers. Put all your fields on the
detail line and in the properties page, set hide duplicates to the
grouping that corresponds to the fields you're in.
Hope this helps someone else!
KellyLeia@.gmail.com wrote:
> Okay...i haven't been able to find any answers to this question mostly
> because i think its hard to search for. If someone can provide a link
> to a website, that would be super. I have a report that is current
> laid out, with grouping, like so
> Header1
> Header2.1
> Header3
> Details
> Details
> Details
> Details
> Header2.2
> Header3
> Details
> Details
> Details
> Details
> Does anyone know how to make it lay out like this...
> Header1 Header2.1 Header3 Details
> Details
> Details
> Details
> Header2.2 Header3 Details
> Details
> Details
> Details
> I've played with some grouping, but it's not working.
> Solutions/suggestions

Sunday, February 19, 2012

Gridview refresh after update

Hi All,

I am new to development of asp. I have an SQLDataSource set as the data source for a grid view. When I click on the edit link in the Gridview, change the data, and click update, the old data is still displayed in the row.

I found exact same issue as here --http://forums.asp.net/thread/1217014.aspx

Solution in the above thread is to add this

{
if (reader != null) reader.Close();
}
conn.Close();

How do I apply above solution in my situation ?

I am updating through stored procedure.and don't have code at background. My code is

Datasource :

<

asp:SqlDataSourceID="ds"runat="server"ConnectionString="<%$ ConnectionStrings:ds %>"

CancelSelectOnNullParameter="False"ProviderName="<%$ ConnectionStrings:ds.ProviderName%>"UpdateCommand="usp_save"UpdateCommandType="StoredProcedure"EnableCaching="False">

<UpdateParameters>

<asp:ParameterName="field1"Type="String"/><asp:ParameterName="field2"Type="String"/><asp:ParameterName="field3"Type="String"/><asp:ParameterName="field4"Type="String"/><asp:ControlParameterName="field5"Type="String"ControlID="label7"/></UpdateParameters>

Anyone Please ?? Help me with this . I am still not able to find the solution.

Thanks in advacne

|||Where is your select statement?|||

Thanks for the reply .

I do select also using stored procedure. I can post stored procedure code if needed.

Here is the full sqldatasource and function

<asp:SqlDataSource
ID="idpl"
runat="server"
ConnectionString="<%$ ConnectionStrings:idpl %>"
SelectCommand="sp_Mapping"
SelectCommandType="StoredProcedure"
CancelSelectOnNullParameter="False"
ProviderName="<%$ ConnectionStrings:idpl.ProviderName%>"
UpdateCommand="sp_SaveMapping"
UpdateCommandType="StoredProcedure"
OnUpdating="pnl_Updating" EnableCaching="False">
<SelectParameters>
<asp:ControlParameter ControlID="Txt1" Name="OriginalID" Type="String" PropertyName="Text" DefaultValue="" />
<asp:ControlParameter ControlID="Txt2" Name="Name" Type="String" PropertyName="Text" DefaultValue="" />
<asp:ControlParameter ControlID="DDL" Name="sName" Type="String" DefaultValue="None" PropertyName="SelectedValue" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="OriginalID" Type="String" />
<asp:Parameter Name="sName" Type="String" />
<asp:Parameter Name="PartNum" Type="String" />
<asp:Parameter Name="plantName" Type="String"/>
<asp:ControlParameter Name="userID" Type="String" ControlID = "label7" />
</UpdateParameters>
</asp:SqlDataSource>

protected void pnl_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
DbParameterCollection CmdParams = e.Command.Parameters;
ParameterCollection UpdParams = ((SqlDataSourceView)sender).UpdateParameters;

Hashtable ht = new Hashtable();
foreach (Parameter UpdParam in UpdParams)
ht.Add(UpdParam.Name, true);

for (int i = 0; i < CmdParams.Count; i++)
{
if (!ht.Contains(CmdParams[i].ParameterName.Substring(1)))
CmdParams.Remove(CmdParams[i--]);
}

}

|||

Does the database values change?

If no, then the update isn't happening correctly, use the sql profiler to see what is being generated, and why it is failing to update correctly.

If yes, then in the sqldatasource's Updated event, add a gridview.databind and see if that resolves your problem. If it does not, place a breakpoint in the sqldatasource's Selecting event, and make sure that it is getting called after an update.

|||

Yes .. Database value changes.So stored procedure is definitely working.

I'll try to follow your suggestions on updated event and update the post soon.

Thanks for your help.

|||

Hi Motley,

I followed your suggestion.

1. Added gridview.databind at "updated" event.

2. Applied the breakpoint and made sure that the even is getting fired.

Still having the same issue. Gridview still shows two rows. Old and newly updated.

Any more pointers will be greatly appreciated.

Thanks

|||

Not sure if your problem is fixed or not. Sounds like your update statement has truncated to an insert statement. Have you looked into make sure it is pulling the PK of the table that singularly references the field you are looking for?