|
Hope it helped
I Love SQL
|
|
|
|
|
http://www.dotnetjohn.com/articles.aspx?articleid=54
Regards
John
|
|
|
|
|
Hi all,
I have a GridView that gets populated with a sqldatasource, then I have a detailsview that I use to update the values in the database, the gridview has autogenerateselect=true and when you select the row it should populate the details view, but I'm having trouble and the only reason that I can think of is because I have 2 columns as the primary key, because when I click on the select button on the gridview the detailsview just disapears. Can anyone please point me into the right direction as how I could fix this.
Here is the code that I use.
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
DataKeyNames="menu_id,menu_language" AutoGenerateColumns="false" AutoGenerateSelectButton="true" AllowPaging="true">
<Columns>
<asp:BoundField ReadOnly="false" HeaderText="Id" DataField="menu_id" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Language" DataField="menu_language" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Text" DataField="menu_text" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="url" DataField="menu_url" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Avtive" DataField="menu_active" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Content Id" DataField="menu_content_id" NullDisplayText="N/A" />
</Columns>
</asp:GridView>
</div>
<div>
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px"
DataSourceID="SqlDataSource2" AutoGenerateRows="false" DataKeyNames="menu_id,menu_language"
AutoGenerateDeleteButton="true" AutoGenerateEditButton="true" AutoGenerateInsertButton="true">
<Fields>
<asp:BoundField ReadOnly="false" HeaderText="Id" DataField="menu_id" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Language" DataField="menu_language" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Text" DataField="menu_text" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="url" DataField="menu_url" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Avtive" DataField="menu_active" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Content Id" DataField="menu_content_id" NullDisplayText="N/A" />
</Fields>
</asp:DetailsView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="Select * from [menu_items]"
ConnectionString="<%$ connectionStrings:localSqlServer %>">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
SelectCommand="Select * from [menu_items]"
FilterExpression="menu_id = '{0}' and menu_language='{1}'"
ConnectionString="<%$ connectionStrings:localSqlServer %>"
DataSourceMode="DataSet"
UpdateCommand="Update [menu_items] set [menu_text] = @menu_text, [menu_url] = @menu_url, [menu_active] = @menu_active,
[menu_content_id] = @menu_content_id where [menu_id] = @menu_id and [menu_language] = @menu_language"
InsertCommand="Insert into [menu_items] values(@menu_id, @menu_language, @menu_text, @menu_url, @menu_active, @menu_content_id)"
DeleteCommand="Delete from [menu_items] where [menu_id] = @menu_id and [menu_language] = @menu_language"
ConflictDetection="OverwriteChanges" EnableCaching="true"
CacheKeyDependency="MyKey" CacheDuration="Infinite">
<FilterParameters>
<asp:ControlParameter Name="menu_id" ControlID="GridView1" PropertyName="SelectedValue" />
<asp:ControlParameter Name="menu_language" ControlID="GridView1" PropertyName="SelectedValue" />
</FilterParameters>
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
I got this working, I changed the PropertyName of the ControlParameter from SelectedValue to SelectedDataKey[index]
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
I have a page that creates gif images in asp.net. i stored the image name in my hashtable. now i want to delete the file when the user closes the page or when the session ends. The session_start fires ok. I have set my sessionState on web config file to <sessionstate mode="InProc">
but session end does not seem to fire.
Please please help
please help
Don't argue with a fool because he/she will bring you down and beat you with exprience
|
|
|
|
|
hi,
Delete all session setting from web.config file or apply default setting at there. The default setting for SessionState is "InProc".
Try this.
Naresh Patel
|
|
|
|
|
Thanks but i did that ecxatly, but its not working!!!
i have got this on my web.config file: <sessionstate mode="InProc">
on my page i have this line session("fileName") = strFilename
on Session_start i have
Session("Started") = "True"
on Session_End i have
FileIO.FileSystem.DeleteFile(Session("fileName").ToString)
but still it not firing...
Motivation alone is not enough, if you have an idiot and you motivate him/her, you now have a motivated idiot
|
|
|
|
|
For deleting use System.IO.File.Delete("fullfilenamewithpath");
Naresh Patel
|
|
|
|
|
You wanna see the session_end events firing, hum?
Set the breakpoint in Session_End event.
Restart the IIS.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi All!
i'm creating web application,there in one web form(A) i'm using PostBackUrl for one button,when user click that button it view the new web form(B).In web form (A) have textbox so i have insert ajax MaskEditExtender for check the Invalid datetime and required fields.
i use if(textbox.text !=string.empty)
{
string a=textbox.text
}
else
{
return;
}
my problem is i return when there there is empty it's nt working,its postback to Page (B)
Please someone help me to do this.
|
|
|
|
|
Hi,
You can use MaskedEditValidator for validating DateTime. And another thing is that do not use PostBackUrl, use Response.Redirect("Page Url") for simplicity.
Ok.........
Naresh Patel
|
|
|
|
|
thanks, i tried Response.Redirect its validating and its viewing the target page.But its not view my report.
|
|
|
|
|
Hi Frinds,
I really need your help. I am trying to fix a problem with media player for last 4 days but still I could not found any solution. Problem is that I have a media player on my web page. I am passing a playlist "Myplaylist.asx" to the player, this player just have one "Entry" inside it. I want when user clicks "Next" button then player should play the same media file. it works fine with "Previous" button but not with "Next". I don't know why? If I am able to find an event that could be fire when user clicks on "Next" and "Previous" button then it is also good. I am quite open to have solution. Please tell me anything if you know please soon. it is really urgent.
Thanks
Abubakar
|
|
|
|
|
Hi all,
When iam publishing my site iam getting this error.
Any ideas why???
Error Date: 8/13/2007 11:32:33 AM
IP Address: 127.0.0.1
URL: /OperationalRisk/ASPXPages/Admin/StandardTables/Default.aspx
Error Message: c:\inetpub\wwwroot\OperationalRisk\Controls\Admin.ascx(1): error BC30456: 'CreateResourceBasedLiteralControl' is not a member of 'ASP.controls_admin_ascx'.
Error Source: System.Web
Stack Trace: at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile) at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath) at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry) at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.PageParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
|
|
|
|
|
Hi,
There is no problem in your coding, But this is your Visual Studio's Problem. Please restart it, and then see it.
Naresh Patel
|
|
|
|
|
I tried but still getting same error. P.S. i have installed VS2005 sp1 a month ago. Any ideas on what should i do and wether this error will appear if i deployed the application for the client.
|
|
|
|
|
Hi,
Please remove the check from "Allow this precompiled site to be updatable"
And then try...
Naresh Patel
|
|
|
|
|
dear all i want to display the following structure inside grid.
First Previous 1 of 10(inside a text box) Next Last
or
<< < 1 of 10 > >>
Can anyone help me with source/example/steps.
sanjay kumar samantaray
|
|
|
|
|
Hi all,
I have to make a call to a central stand alone class, which will write auditing data to the database.
I was wondering which would be the quickest way; either from a httpModule or via the Page_load event of our master pages?
Please can any one advise, as I cant seem to find any answers on the web
many thanks
Janet
Lady Programmers are a rare breed!
|
|
|
|
|
Janet Dixon wrote: either from a httpModule or via the Page_load event of our master pages?
I feel through HTTPModule. Of course there won't be much performance difference for both methods. But HTTPModule will be easy for maintaining/updating later.
|
|
|
|
|
Thx v.much
Lady Programmers are a rare breed!
|
|
|
|
|
hi all
i am deverloping web application to shoping card
i have question to card, some body tell me this card will store in session. but i afraid it will time out
could someone tell me ?
do u know some web site as amazon, what kind of card it store
|
|
|
|
|
What are you talking about ? Do you mean shopping cart ? Or do you mean a credit card ?
Yes, a session will time out, that's inevitable. You can store what someone has in their cart in a cookie, or in your database, if they need to log in to use it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry it credit card, but if store in cookie after transaction it sitll get all data credit card
or after finish transaction so delete this cookie
-- modified at 0:51 Tuesday 14th August, 2007
|
|
|
|
|
hi friend
i am using remoting on same system then its work properly . if i using remoting server on different system and client on different system then error generates:-
A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or ImpersonationLevel.
any body tell me what problem here and how to remove this problem...
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|