|
you left out the class identifier, i.e. private const string VirtualRoot instead of private const VirtualRoot
www.socoder.net
|
|
|
|
|
oh, yeah...
Thanks!!!
|
|
|
|
|
Hi,
I am getting arithmatic Over flow exception in .NET.
i.e Arithmetic overflow error for type money
But I want to write a convinent message for this:
catch(ArithmeticException)
{
-------
-------
}
catch (Exception ex)
{
-------
-------
}
but the exception enters in catch (Exception ex) not in catch(ArithmeticException)
any ideas. I am using C#.
Thanks in Advance
|
|
|
|
|
Look at the type of ex when it is thrown and then you will know the correct exception. Break points are your friend and can be much faster than documentation.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
What a mess......
Description: I have a large scale asp.net 1.1 application I'm trying to move to 2.0. I'm hoping to improve some aspects in the port. It's made up of many modules, separate web applicaton projects, different directories (not nested), and it's all connected via IIS. I can open, run, debug, etc. Works great. Design time support is very lacking.
VS 2008
I'm trying to build a new framework using 2.0. Now that 2.0 has the whole master pages feature built in I figure I'd dump the old 1.0 approach. So far I've got that working. But now the controls. Before I'd have ascx files (standalone, don't inherit from anything) and then my pages would reference user controls (by class, NOT ascx) that are not attached to any ascx. Based on settings, or if an override ascx file is found in another directory, this usercontrol would dynamically load the PROPER ascx file and add it to it's empty control collection. It would then look for the appropriate controls in that loaded control, and move data accordingly.
I've read about the asp.net 2.0 'themes and skins' but this doesn't seem to do what I want. This is more about just styles, colors, etc then actually allowing one to provide a whole new ascx file with a radical new layout. Or does it and I'm missing something?
I can make the old approach work in VS2008 with the same lack of any designer support.
One issue with building ascx controls with codebehind and referencing those ascx's directly from a page is that it's all broken as soon as you add these controls in a subweb. The path in the register tag doesn't work. Either you set the tag so it works in design time breaking the runtime or vice versa. You can have one but not the other. Because of this I have my ascx and cs disconnected. My pages reference the cs directly which is nice since no path is involved.
So, the big questions.
1) If I register an ascx directly in a page, how can I make it work in both design time and runtime? Designtime path is relative to the project. Runtime path needs to include the subdirectory that the sub web application project is in. Is there any way to make this work?
2) Is there anything NEW in asp.net 2.0 or VS2008 that will allow me to create a UserControl (ascx and codebehind cs) but then at runtime change which ascx to actually load? It would be nice to have the designtime integration of the ascx and cs working together. But then at runtime, maybe I want a different ascx? But I don't want to have to change all the register tags in all the pages that reference that. My current app ships with all the default ascx files but then if I want to change something, I can just make a new version of an existing ascx file, place it in a client override skins directory and my application loads that. Of course, the current app, the ascx and cs are disconnected.
|
|
|
|
|
Hi,
I have a converted rdlc file that uses 3 datasets, all of which takes the same two parameters being passed from the requesting page. But when I run it - I get "parameter 'Parameter1' is missing a value" error. FYI, I set default values for both of them.
Any ideas?
Thanks.
Ekjon
|
|
|
|
|
Don't cross post.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
You are missing something with the parameter. Showing your code that you use to pass the parameters can be helpful if you want people to help.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
|
Sorry, Please ignore the previous one. When invoking the .aspx, I'm using:
----------------------------------------------------------------------------
<form method='get' name='frmSQLReport' id='frmSQLReport' action='StationReport.aspx' style='display: inline;'> ........
<input type='hidden' name='rc:Parameters' value='false' />
<input type='hidden' name='Parameter1' id='Parameter1' value='<%= Parameter1 %>' />
<input type='hidden' name='Parameter2' id='Parameter2' value='<%= Parameter2 %>' />
/form>
<script language="JavaScript" type="text/javascript">
<!-- document.frmSQLReport.submit(); //--></script>
-----------------------------------------------------------------------------------
<form id="form1" runat="server">
<div>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
Height="359px" Width="736px" PromptAreaCollapsed="True">
<LocalReport ReportPath="StationReport.rdlc" EnableExternalImages="True">
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="ImageDataSet" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString3 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString3.ProviderName %>" SelectCommand="SELECT...WHERE (SITE_ID = :Parameter1) AND (STATION_ID = :Parameter2)">
<SelectParameters>
<asp:FormParameter FormField="Parameter1" Name="Parameter1" DefaultValue="01" Type="String" ConvertEmptyStringToNull="False" Size="2" />
<asp:FormParameter FormField="Parameter2" Name="Parameter2" DefaultValue="001" Type="String" ConvertEmptyStringToNull="False" Size="3" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="DataSetSub" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" SelectCommand="SELECT...WHERE..AND..AND..AND (SITE_ID = :Parameter1) AND (STATION_ID = :Parameter2)">
<SelectParameters>
<asp:FormParameter FormField="Parameter1" Name="Parameter1" DefaultValue="01" Type="String" ConvertEmptyStringToNull="False" Size="2" />
<asp:FormParameter FormField="Parameter2" Name="Parameter2" DefaultValue="001" Type="String" ConvertEmptyStringToNull="False" Size="3" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="StationDataSet" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT...WHERE..AND..AND..AND (S.SITE_ID = :Parameter1) AND (P.PLOT_ID = :Parameter2)">
<SelectParameters>
<asp:FormParameter FormField="Parameter1" Name="Parameter1" DefaultValue="01" Type="String" ConvertEmptyStringToNull="False" Size="2" />
<asp:FormParameter FormField="Parameter2" Name="Parameter2" DefaultValue="001" Type="String" ConvertEmptyStringToNull="False" Size="3" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
|
|
|
|
|
Oops, I already replied. See my post about using the <code></code> tags. You highlight your code and press Shift+Ctrl+C, and it makes it much easier to read
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Yuck! Use the <code></code> tags when posting code next time. It is very unreadable... From what I can tell, looks okay, must be something subtle. Are the field names matching in the database and code? Also, is it in the same order? Sometimes weird things like that can cause havoc.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Field names were used in the SQL statement, and the SQLs are tested. The parameter names are same in the page thats passing their values and in the report page and in the SQL statements.
Yeah, sure it's something subtle.
|
|
|
|
|
Hi
I have a checkbox which is displayed on a page
The checkbox is ticked
when the page loads i want the following to run:
if (CheckBox_room_reviewed.Checked == true)
{
lbl_username.Visible = true;
}
else if (CheckBox_room_reviewed.Checked == false)
{
lbl_username.Visible = false;
}
but it doesnt show the lblusername.
If i clcik on a radiobutton which is on my page and postback then it shows
how do i get it to show when the page first loads
ive tried page_init and it doesnt work in there either
thanks in advance
|
|
|
|
|
Use the code tags when posting code. It makes it easier to read. Is your checkbox's default value false when you first load the page? Also, if-else if is not necessary for what you are doing.
Try: lbl_username.Visible=CheckBox_room_reviewed.Checked
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
have you add ?
if (!ispostback)
{
}
|
|
|
|
|
Hi,
I think you are writing the code like this
if (!IsPostBack)
{
if (CheckBox1.Checked == true)
{
TextBox3.Visible = true;
}
else if (CheckBox1.Checked == false)
{
TextBox3.Visible = false;
}
}
remove the !IsPostBack condition and try then it will work.
Bhanu
|
|
|
|
|
Hi,
Can anybody suggest me an idea , that how can i run ffmpeg.exe in my web server, as my web server is running in shared hosting, bcoz of it i do not have execute permission.
thanks regards
|
|
|
|
|
You may not ask in a discussion forum tips on hacking and compromising the security of network which is unethical.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Actually u misunderstood my intentions.
What i am facing is that,i have developed a video upload site where mpeg or avi format is converted into flv format through ffmpeg.exe, it is running fine in local system , but as i am using share hosting facility i cannot run ffmpeg.exe as i do not have execute permission.
That's y i ask for a soln.
|
|
|
|
|
If your provider is not providing executable permission, then you won't be able to do this.
|
|
|
|
|
Hi all i have developed an asp.net 2.0 application with sql2005. it is running ok at my pc. When i tried to deploy it at the customer site i am receiving an error when i hit login. I can acccess the login page but when i enter username and password and press login i get the following error:
System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
I have Allow remote connections using TCP/IP enabled on
any ideas???
|
|
|
|
|
Hi gurus, I'm creating an application with scalability in mind. In my application, I'll have forums used by different groups of people (each group will have their own forums). I will start from 1000 or 2000 groups with the potential to grow until 5000 groups (it's guaranteed that I won't exceed that number of groups, 5000, based on the nature of my application). I was thinking that having all the forum posts in one table will cause many problems like having a very large index and slow search among other problems (as I want to have many indexes on the table like the PostID, ForumID, GroupID and PostDate), so, I was thinking that it might be better to have a separate table for each group's forum posts in order to have small indexes so that I have faster searches and inserts take less time (esp. that some groups are expected to have a large number of posts per day) and also to be easier to move the tables to other database servers in case the application grows and so the web farm. Now I'm really confused how to design my DAL.
Assuming that the structure of the forum posts table is like that (this is just a simplified structure not the real one):
CREATE TABLE ForumPosts_x
(
PostID INT IDENTITY(1,1) PRIMARY KEY,
ForumID INT NOT NULL, -- which refers to the ForumID in another table named Forums which includes all forums for all groups
ParentPostID INT NULL,
PostSubject NVARCHAR(200) NOT NULL,
PostText NVARCHAR(5000) NOT NULL,
PostDate DATETIME NOT NULL DEFAULT GETUTCDATE()
)
Note that there's no group ID as x in the table name will be the group id e.g. ForumPosts_19 for group id 19
Now as to designing my DAL, should I:
1. Create stored procedures with dynamic SQL and pass the group id to the procedure i.e. use EXEC and sp_executesql (there's an interesting article on the subject here: http://www.sommarskog.se/dynamic_sql.html)
For example:
CREATE PROCEDURE InsertForumPost
@GroupID INT,
@ForumID INT,
@ParentPostID INT,
@PostSubject NVARCHAR(200),
@PostText NVARCHAR(5000)
AS
DECLARE @tablename NVARCHAR(50), @sql NVARCHAR(4000)
SET @tablename = N'ForumPosts_' + @GroupID
SET @sql = N'INSERT INTO dbo.' + quotename(@tblname) +
' (ForumID, ParentPostID, PostSubject, PostText) VALUES (' +
'@ForumID, @ParentPostID, @PostSubject, @PostText)'
EXEC sp_executesql @sql, N'@ForumID INT, @ParentPostID INT, @PostSubject NVARCHAR(200), @PostText NVARCHAR(5000)', @ForumID, @ParentPostID, @PostSubject, @PostText
2. Create the procedures with static SQL for each group. i.e. each group has its own set of procedures which would make us have a large number of procedures
For example, the procedure for inserting a new forum post for GroupID #19 would be:
CREATE PROCEDURE InsertForumPost_19
@GroupID INT,
@ForumID INT,
@ParentPostID INT,
@PostSubject NVARCHAR(200),
@PostText NVARCHAR(5000)
AS
INSERT INTO dbo.ForumPosts_19
(ForumID, ParentPostID, PostSubject, PostText)
VALUES
(@ForumID, @ParentPostID, @PostSubject, @PostText)
3. Use SQL text directly in my code, C# in my case (which I'm highly considering but a little concerned about how to execute multiple SQL statements - as you have in stored procedures - without having to call ExecuteNonQuery() multiple times, which I believe could affect performance)
4. Drop the whole thing and stick to using one table for all the groups
What would you do if you were designing such application? Any suggestions are highly appreciated...
|
|
|
|
|
Hey Please help me.
i have a login page and when user try to logon on webpage i save userId in session and i check if session is null then redirect to login else stay.
But i have that problem at if user not move the mouse or not are front the computer about 2 minutes , the session redirct to login page ? how can i disiable that funktion or what can i do .
the application is writen in C# asp.net
Thanks very mutch.
Sorry my english.
|
|
|
|
|
i think it not possible it is possible to decrease session or increase session in web.config at your connection string......
<connectionstrings>
<add name="TRDConnectionString" connectionstring="Data Source=(local);Initial Catalog=Trade;User ID=123;Password=123;timeout=60" providername="System.Data.SqlClient">
your can increase or decrease the TimeOut optin.........
send feed back to sk.haneef@gmail.com
|
|
|
|
|