Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Wednesday, March 21, 2012

group properties

Hello,
I added a group to my report but I could not get a plus sign on it so that I
can click to expand and collapse, how can I put + there?
Thank,
Jim.Are you using a tabular report? If so highlight the entire detail row below
the group level. (Click on the row selector with three dashes icon on the
left of the table to do this). Go to the properties sheet, keeping the row
selected. Expand the Visibility property in the Properties sheet. Set the
Hidden property to True, and for the ToggleItem, specify a field which is in
the Group section.
HTH
Charles Kangai, MCT, MCDBA
"JIM.H." wrote:
> Hello,
> I added a group to my report but I could not get a plus sign on it so that I
> can click to expand and collapse, how can I put + there?
> Thank,
> Jim.
>

Sunday, February 19, 2012

GridView UPDATE Problem

Hi Gutys

I am having problem with my UPDATE in GridView, it is saying that I have too many argument, I don't
This happens when I click the UpdateCommand in GRIDVIEW

Procedure or function UpdateCountry has too many arguments specified.

<asp:SqlDataSource ID="mySqlDataSource" Runat="server"
SelectCommandType="StoredProcedure" SelectCommand="ShowCountry"
UpdateCommandType="StoredProcedure" UpdateCommand="UpdateCountry"
ConnectionString="<%$ ConnectionStrings:ConnString %>">
<UpdateParameters>
<asp:Parameter Type="String" Name="CountryName"></asp:Parameter>
<asp:Parameter Type="String" Name="CountryID"></asp:Parameter>
</UpdateParameters>
</asp:SqlDataSource
Just In case these are my Stored Procedures
**************************************************************************
CREATE PROCEDURE [dbo].[UpdateCountry]
@.CountryName varchar(50),
@.CountryID varchar(50)
AS
UPDATE EkeanyanwuO.tCountry SET [CountryName] = @.CountryName WHERE [CountryID] = @.CountryID
GO
************************************************************************************
CREATE PROCEDURE [dbo].[ShowCountry] AS
SELECT TOP 100 PERCENT EkeanyanwuO.tIMSREGION.ImsRegionName AS ImsRegionName, EkeanyanwuO.tCountry.CountryName AS CountryName,
EkeanyanwuO.tIMSREGION.ImsRegionID AS ImsRegionID, EkeanyanwuO.tCountry.CountryID AS CountryID
FROM EkeanyanwuO.tCountry INNER JOIN
EkeanyanwuO.tIMSREGION ON EkeanyanwuO.tCountry.ImsRegionID = EkeanyanwuO.tIMSREGION.ImsRegionID
ORDER BY EkeanyanwuO.tCountry.CountryName
GO
************************************************************************************

The ConflictDetection property of DataSource set to OverrideChanges. The problem will be solved. :D

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?

Grid pane in the table in enterprise manager

HI
When you right click open table to return all rows, click on the "Show/Hide Grid pane" icon . When you click on any row the first column called "Column" a dropdown shows all the filed names of that particular table.
This feature used to work fine untill recently wherein when I click on the column, I don't get to see all the filed names but now it just shows TableName.* i.e. all columns.
This is the case when I try to create a view in enterprise manager also. When you add a table to create a view, I cannot see all the filed names . I'm not sure what to do , to get the field names to appear? Is it some kind of setting in enterprise manager.
All the info would be appreciated.
Ta
NStop using Enterprise Manager (EM) and start using Query Analyzer (QA)

My own opinion

MOO

EM tends be quirky...|||I do use the Query analyser more than the EM, but it's just a functionality would reappear in the EM. Ta