|
I always copy the pointer to a buffer like ipAddress before using it.
if (Request.ServerVariables["REMOTE_ADDR"] != null){
ipAddress String = Request.ServerVariables["REMOTE_ADDR"];
sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = ipAddress;
}
else
{
sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
}
|
|
|
|
|
Hi,
am having an excel file where it consists data as below
ID NAME DE
1 SURESH SE
2 SANJAY SE
3 NAGA TL
ID,NAME,DE are columns...
if the data in excel file is in the above format then i can easily transfer the data into database
but my problem is sometimes the data in excel sheet will be in the below format
ID NAME DE ID NAME DE
1 SURESH SE 4 RANK TL
2 SANJAY SE 5 RAMU PL
3 NAGA TL 6 RANI PM
here the Columns ID,NAME,DE are repeated so i want to make it in the below format and want to insert into database
ID NAME DE
1 SURESH SE
2 SANJAY SE
3 NAGA TL
4 RANK TL
5 RAMU PL
6 RANI PM
please help me out...
|
|
|
|
|
I am having problem with one line compiling in a production C# 2010 web form application. The line of code that is having the problem is either of the two following lines:
<%@ language="c#" debug="true" trace="false" %>
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
the error message is: 'Error 1 Could not load file or assembly 'MasterPages' or one of its dependencies. The system cannot find the file specified.
I am hoping you can tell me what is wrong. Could a url to iis7 local server be incorrect?
I orginally had the folloing 3 extra lines of code of code that contained error messages:
Error 2 Unknown server tag 'mp:contentcontainer'. C:\Users\Sup\TestPage.aspx 14
Error 3 Unknown server tag 'mp:content'. C:\Users\Sup\TestPage.aspx 16
Error 4 Unknown server tag 'mp:content'. C:\Users\Sup\TestPage.aspx 22
I fixed the above error message by adding the following to the web config file:
<system.web><pages><controls>
<add assembly="MasterPages" namespace="Microsoft.Web.Samples.MasterPages" tagPrefix="mp" />
<add src="~/sub/TestMasterPage.ascx" tagName="contentcontainer" tagPrefix="mp" />
</controls></pages></system.web>
The following is code for TestPage.aspx that is causing the error:
<%@ language="c#" debug="true" trace="false" %>
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
<script runat="server">
void ClickedCapitalize(object o, EventArgs e) {
capitalized.Text = Server.HtmlEncode(tb1.Text.ToUpper());
}
void SayHello(object o, EventArgs e) {
name.Text = Server.HtmlEncode(tb2.Text);
}
</script>
<mp:contentcontainer runat="server" MasterPageFile="sub/TestMasterPage.ascx">
<mp:content id=region1 runat="server">
<a href="MasterPages.htm" runat="server">Relative link test</a><br>
<asp:textbox id=tb1 runat="server"/><asp:button text=Capitalize onclick=ClickedCapitalize runat="server"/>
<asp:literal id=capitalized runat="server"/>
</mp:content>
<mp:content id="region2" runat="server">
<asp:textbox id="tb2" runat="server"/><asp:button text="Say hello" onclick="SayHello" runat="server"/>
Hello <asp:literal id="name" text="[name goes here]" runat="server"/>!
</mp:content>
</mp:contentcontainer>
|
|
|
|
|
classy_dog wrote: Error 1 Could not load file or assembly 'MasterPages' or one of its dependencies. The system cannot find the file specified.
Ok, it was not too clear based on your previous query asked last time, but now:
You are trying/working on an old project and trying to convert/add new features based on ASP.NET 2.0 above. You last project was probably in v1.1
When there was no concept of master pages, people writing your application code at that time, create a custom control/assembly named 'MasterPages' and used that as per need. Now, it looks like you thought/took it as ASP.NET master page and facing issues.
So, to be clear, the assembly in question 'MasterPages.dll' is your custom assembly and not ASP.NET assembly. This assembly is missing and you need to find and provide a reference to it in order to resolve the above errors.
|
|
|
|
|
I have a C# 2010 web form application that I would like to step though the code. I can put breakpoints in the *.aspx.cs files but I can not put breakpoints in the .aspx files. Thus is there any way that I can debug the .aspx pages? If so, can you tell me how to debug the *.aspx pages directly?
|
|
|
|
|
dcof wrote: Thus is there any way that I can debug the .aspx pages?
No. You cannot debug aspx pages. They are not server codes, they turn into plain HTML's.
Further, it's hard to think of a reason on why debugging 'aspx' code would be needed.
|
|
|
|
|
I am getting some errors in production application when I am trying to use the local iis. I do not know how to remove these errors.
|
|
|
|
|
Post an example of the error you are receiving and the folks here might be able to point you in the right direction for finding the problem.
The more details about the problem, the better.
Good luck.
|
|
|
|
|
I have a question about understanding how the master pages in C# 2010 web application are linked (wired together). I am asking that question since I believe I and/or my co-worker placed some test code in the location where the production code was actually stored.
What is happening is when I try to debug the production application using iis 7, a reference to a master page and/or an *ascx file is lost. The file that it is trying to access, is for a test version of one of the production modules. This test version of the production code is mainly commented out in the code right now. The part of the test code that actually is running is the startup file name that looks like 'startup2.aspx'. The test code is actually calling 'startup2.aspx' instead of 'startup.aspx'.
Thus to understand how the master pages are wired together I am thinking that I will debug the application from the time any code starts running. Can you tell me if this is a good idea?
Also I am wondering if you can tell me how master pages are actually 'wired' together? is there a good reference that I can look at?
|
|
|
|
|
dcof wrote: I am thinking that I will debug the application from the time any code starts running. Can you tell me if this is a good idea?
Yes, that should help. Do, make sur before making this effort, you clear your temporary files, cache, reset IIS and then recheck things on how they are working (just to avoid these be the reason of old file refrence issue.) BTW, I hope if there was a new deployment then, it's not just a file.
dcof wrote: is there a good reference that I can look at?
Look here:
MSDN: ASP.NET Master Pages[^]
ASPNET: ASP.NET Master Pages Tutorials[^]
ASP.NET 2.0 Master Pages[^]
|
|
|
|
|
When you mention "clear your temporary files, cache, reset IIS", I think you mean I should stop and start my workstation and stop and start iis that is on my work station correct? If this is not what you mean, can you tell me what you mean?
You mentioned, "I hope if there was a new deployment then, it's not just a file." There was no new deployment. Thus what would I be concerened about with a file?
Thanks for the online references!
|
|
|
|
|
dcof wrote: "clear your temporary files, cache, reset IIS", I think you mean I should stop and start my workstation and stop and start iis that is on my work station correct?
No, not just that, you need to also clear your browsers cache and system temporary files.
dcof wrote: I hope if there was a new deployment then, it's not just a file." There was no new deployment. Thus what would I be concerened about with a file
If you are replacing/updating a file then you need to make sure it's nothing more than a ASPX file with all it's class references intact. If you make any change in code behind file then you need to rebuild before deployment.
|
|
|
|
|
Hey, Just something to note, everybody is lead to believe that content pages are placed in to master pages when the application runs but it's actually the other way round, when you run you application, the webpage you run actually pulls the master page an displays it. So in short the content page is fired first and then the master page. Hope this helps you understand.
|
|
|
|
|
Hi,
What kind of host server (CPU? RAM? or anything else that is important)is suitable to support an application written in ASP.net and SQLserver 2008, which should handle 10000 users and around 1 GB data at one time parallely.
|
|
|
|
|
Hi,
In an asp.net application I want to convert xsl fo to xslt, is there any way that I can convert the xslfo to xslt or word or pdf just using MS.Net library, not any other tool to buy, I want to just use .Net framework.
Any kind of suuport like a code snippet or a link any kind of support would be really really helpfull.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 2-Jul-12 12:59pm.
|
|
|
|
|
Hi,
I my asp.net application I have to save a .doc file in to pdf file, so I am using the
Document.ExportAsFixedFormat method to convert and save as pdf. But it is storing only on to the disk in a physical location.
Is there any way that I can store output file pdf as a stream rather than in a physical location. Any kind of help would be really helpful please help me I am in a dire need.
If there is any alternate method available I am ready to accept it, any links or any advice is acceptable for me.
Thanks in advance. Below is my code.
Public Shared Function convertDoc2PDF(ByVal sourcePath As Object, ByVal targetPath As Object) As Boolean
Dim result As Boolean
Dim paramMissing As Object = Type.Missing
Dim wordApplication As New ApplicationClass
Dim wordDocument As Document = Nothing
Try
Dim paramSourceDocPath As Object = sourcePath
Dim paramExportFilePath As String = targetPath
Dim paramExportFormat As WdExportFormat = WdExportFormat.wdExportFormatPDF
Dim paramOpenAfterExport As Boolean = False
Dim paramExportOptimizeFor As WdExportOptimizeFor = WdExportOptimizeFor.wdExportOptimizeForPrint
Dim paramExportRange As WdExportRange = WdExportRange.wdExportAllDocument
Dim paramStartPage As Integer = 0
Dim paramEndPage As Integer = 0
Dim paramExportItem As WdExportItem = WdExportItem.wdExportDocumentContent
Dim paramIncludeDocProps As Boolean = True
Dim paramKeepIRM As Boolean = True
Dim paramCreateBookmarks As WdExportCreateBookmarks = WdExportCreateBookmarks.wdExportCreateWordBookmarks
Dim paramDocStructureTags As Boolean = True
Dim paramBitmapMissingFonts As Boolean = True
Dim paramUseISO19005_1 As Boolean = False
wordDocument = wordApplication.Documents.Open( _
paramSourceDocPath, paramMissing, True, _
paramMissing, paramMissing, paramMissing, _
paramMissing, paramMissing, paramMissing, _
paramMissing, paramMissing, paramMissing, _
paramMissing, paramMissing, paramMissing, _
paramMissing)
If (wordDocument IsNot Nothing) Then
wordDocument.ExportAsFixedFormat(paramExportFilePath, _
paramExportFormat, paramOpenAfterExport, _
paramExportOptimizeFor, paramExportRange, paramStartPage, _
paramEndPage, paramExportItem, paramIncludeDocProps, _
paramKeepIRM, paramCreateBookmarks, paramDocStructureTags, _
paramBitmapMissingFonts, paramUseISO19005_1, _
paramMissing)
End If
result = True
Catch ex As Exception
result = False
Finally
If (wordDocument IsNot Nothing) Then
wordDocument.Close(paramMissing, paramMissing, paramMissing)
wordDocument = Nothing
End If
If (wordApplication IsNot Nothing) Then
wordApplication.Quit(paramMissing, paramMissing, paramMissing)
wordApplication = Nothing
End If
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
Return result
End Function
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 29-Jun-12 12:30pm.
|
|
|
|
|
Hi
We have a custom tool (a simple web based application) which is created in .NET, as a business requirement we are planning to integrate this tool with TFS such that whenever a workitem is created it gets exported to our tool and whenever any update is made to workitem in TFS same changes get applied to workitem created in our tool.
Any Ideas, on how this can be achieved ??
|
|
|
|
|
Dear friend ,
have you any idea how can we see CCTV camera on web Page using ASP .net if you have any Clue please tell
|
|
|
|
|
|
how to sent mail using smtp.bizmail.yahoo.com in asp.net.
i have account in smtp.bizmail.yahoo.com
|
|
|
|
|
|
I am asking this question since I have very little experince working with master pages in a C# 2010 web form application. I am trying to put my code into production, but the production code is causing a problem. Basically I know what the error is but I do not know how to fix the problem. Thus I am hoping you can tell me how to fix the problem
Note:There is the file in the following location: sub/TestMasterPage.ascx
Problem: Error 19 Could not load file or assembly 'MasterPages' or one of its dependencies. The system cannot find the file specified. C:\Users\dst\Documents\Visual Studio 2010\Projects\Support\TestPage.aspx 2
The code:
<%@ language="c#" debug="true" trace="false" %>
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
<script runat="server">
void ClickedCapitalize(object o, EventArgs e) {
capitalized.Text = Server.HtmlEncode(tb1.Text.ToUpper());
}
void SayHello(object o, EventArgs e) {
name.Text = Server.HtmlEncode(tb2.Text);
}
</script>
<mp:contentcontainer runat="server" MasterPageFile="sub/TestMasterPage.ascx">
<mp:content id=region1 runat="server">
<a href="MasterPages.htm" runat="server">Relative link test</a><br>
<asp:textbox id=tb1 runat="server"/><asp:button text=Capitalize onclick=ClickedCapitalize runat="server"/>
<asp:literal id=capitalized runat="server"/>
</mp:content>
<mp:content id="region2" runat="server">
<asp:textbox id="tb2" runat="server"/><asp:button text="Say hello" onclick="SayHello" runat="server"/>
Hello <asp:literal id="name" text="[name goes here]" runat="server"/>!
</mp:content>
</mp:contentcontainer>
|
|
|
|
|
Couple of things:
1. Page register attribute:
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
No idea how you got this!
For a Master page, default looks like:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
For a content page, default looks like:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ContentTestMaster.aspx.cs" Inherits="ContentTestMaster" %>
2. Contentcontainer?
<mp:contentcontainer runat="server" MasterPageFile="sub/TestMasterPage.ascx">
What does or where from this line of code came? Looks like you are trying to reference a custom master page kind of stuff. Is that needed?
Look here on how to implement Master Page in ASP.NET:
MSDN: ASP.NET Master Pages[^]
ASPNET: ASP.NET Master Pages Tutorials[^]
CP: ASP.NET 2.0 Master Pages[^]
|
|
|
|
|
I obtained this code from the contractor who wrote the application. I do not know how they set this test code up.
What would you recommend I change?
|
|
|
|
|
Already shared masterPage concept links with you. Have a look at them and try out. If you get stuck, share with us.
|
|
|
|