GridView-FormView (Master/Detail) Control not working...
am 28.01.2008 11:58:15 von yixiangHi All,
I am a newbie to .NET programming and have been figuring out this
(master/detail) control.
However, it is not working...can someone please help me out???
Height="81px" Width="16px">
ProviderName="<%$ ConnectionStrings:ConnectionString2.
ProviderName %>" SelectCommand="SELECT [ServiceID], [VersionNum],
[VersionDesc] FROM [w_ServiceVersion]">
Width="555px">
...........
.............
............
ProviderName="<%$ ConnectionStrings:ConnectionString.
ProviderName %>" SelectCommand="SELECT ServiceID, VersionNum, VersionDesc
FROM dbo.w_ServiceVersion WHERE (ServiceID = ServiceID AND VersionNum =
VersionNum)">
url:http://ureader.com/gp/1417-1.aspx
RE: GridView-FormView (Master/Detail) Control not working...
am 29.01.2008 01:31:01 von mily242Howdy,
Seems you use composite data key on columns ServiceID and VersionNum, but
you two control parameters both point to the first value which in this case
is ServiceID (you can check what's passed to the query by handling
SqlDataSource2.Selecting event and checking e.Command.Parameters[0].Value,
e.Command.Parameters[1].Value). They point to the same value because of you
used GridView1.SelectedValue property which is a shortcut for
GridView1.SelectedDataKey.Values[0], what you need is to change the code to:
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT ServiceID, VersionNum, VersionDesc FROM
dbo.w_ServiceVersion WHERE (ServiceID = ServiceID AND VersionNum =
VersionNum)">
Hope this helps
--
Milosz
"yixiang" wrote:
> Hi All,
>
> I am a newbie to .NET programming and have been figuring out this
> (master/detail) control.
>
> However, it is not working...can someone please help me out???
>
>
> Height="81px" Width="16px">
>
>
>
>
>
>
>
>
>
>
> ProviderName="<%$ ConnectionStrings:ConnectionString2.
> ProviderName %>" SelectCommand="SELECT [ServiceID], [VersionNum],
> [VersionDesc] FROM [w_ServiceVersion]">
>
>
>
>
>
>
> Width="555px">
>
> ...........
>
>
> .............
>
>
>
> ............
>
>
>
> ProviderName="<%$ ConnectionStrings:ConnectionString.
> ProviderName %>" SelectCommand="SELECT ServiceID, VersionNum, VersionDesc
> FROM dbo.w_ServiceVersion WHERE (ServiceID = ServiceID AND VersionNum =
> VersionNum)">
>
>
>
>
>
>
> url:http://ureader.com/gp/1417-1.aspx
>