Jump to content

kwilliams

Members
  • Posts

    229
  • Joined

  • Last visited

Posts posted by kwilliams

  1. The problem is that you are generating <asp:*> elements for the XSLT output without later parsing this output with ASP.NET. Such elements aren't supposed to be rendered by the browser, but only by the server.In order to solve the problem, you need some sort of command that will take the output and evaluate it as if it's a server side scripting code.
    Ok, thanks for the info. I think that you can tell that I'm a newbie to all of this.I was able to find another publishing of the article that actually does contain the downloadable code at http://www.dnzone.com/ShowDetail.asp?NewsId=151. I use VB.NET, so I'll have to convert all of the C# code, but I think that it will point me in the right direction. Thanks again.
  2. I'm following a great article titled "Creating Dynamic ASP.NET Server Controls Using XML" at http://www.devarticles.com/c/a/ASP.NET/Cre...ls-Using-XML/2/, but I'm running into strange problems when I attempt to re-produce the pages.Basically, the ASP.NET server controls show up in the code, but they aren't being displayed on the page. The method I'm using involves XML/XSLT transformation on an ASP.NET page, but I've also tried just attaching the XSLT stylesheet to the XML doc to no avail. So I've included the code that I'm using at the bottom of this post. If anyone can help me to figure out what I'm doing wrong, I'd appreciate it. Thanks.XML DOC:

    <?xml version="1.0" encoding="UTF-8"?><test>	<survey name="Example Survey">		<question type="text" name="Title" required="yes"/>		<question type="text" name="Industry"/>		<question type="radio" name="Education">		<choice>High school</choice>		<choice>Some college</choice>		<choice>College</choice>		</question>	</survey> </test>

    XSLT DOC:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asp="remove"><xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"/><xsl:template match="/">	<div id="content">	<table>		<xsl:for-each select="//question">			<tr>				<td valign="top"><xsl:value-of select="@name" />				<xsl:if test="@required = 'yes'">					<asp:RequiredFieldValidator ErrorMessage="RequiredField" runat="server" ControlToValidate="{@name}" />				</xsl:if>				</td>				<td>				<xsl:if test="@type='text'">					<asp:TextBox id="{@name}" runat="server" />				</xsl:if>				<xsl:if test="@type='radio'">					<asp:RadioButtonList id="{@name}" runat="server">						<xsl:for-each select="choice">							<asp:ListItem Value="{@value}"><xsl:value-of select="@value"/></asp:ListItem>						</xsl:for-each>					</asp:RadioButtonList>				</xsl:if>				</td>			</tr>		</xsl:for-each>	</table>	<asp:button id="submit" runat="server" Text="Submit" />	</div></xsl:template></xsl:stylesheet>

    CODE OUTPUT:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head></head><body>	<form name="_ctl1" method="post" action="index.aspx?page=test" id="_ctl1">	<input type="hidden" name="__VIEWSTATE" value="dDw5OTQ1Mjc4NDc7dDw7bDxpPDE+O2k8Mz47PjtsPHQ8O2w8aTwxPjtpPDM+O2k8Nz47aTw5PjtpPDExPjs+O2w8dDxwPGw8aW5uZXJodG1sOz47bDxEb3VnbGFzIENvdW50eSwgS2Fuc2FzIC0gRmVlZGJhY2sgRm9ybSBURVNUOz4+Ozs+O3Q8cDxsPGhyZWY7PjtsPC9uZXdzaXRlL2RvY3MvY3NzL2dlY2tvLmNzczs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxcZTs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxcZTs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxGcmlkYXksIE9jdG9iZXIgMDYsIDIwMDY7Pj47Oz47Pj47dDw7bDxpPDE+Oz47bDx0PHA8cDxsPFRleHQ7PjtsPEZyaWRheSwgT2N0b2JlciAwNiwgMjAwNjs+Pjs+Ozs+Oz4+Oz4+Oz7sPS4LQzwPyQo7LC8Hr0V7L8jzTw==" />			<!--Dynamic page content from XSLT doc-->			<?xml version="1.0" encoding="iso-8859-1"?>			<div id="content" xmlns:asp="remove">			<table>						<tr>									<td valign="top">Title<asp:RequiredFieldValidator ErrorMessage="RequiredField" runat="server" ControlToValidate="Title" /></td>									<td>												<asp:TextBox id="Title" runat="server" />									</td>						</tr>						<tr>									<td valign="top">Industry</td>									<td>												<asp:TextBox id="Industry" runat="server" />									</td>						</tr>						<tr>									<td valign="top">Education</td>									<td>									<asp:RadioButtonList id="Education" runat="server">												<asp:ListItem Value=""></asp:ListItem>												<asp:ListItem Value=""></asp:ListItem>												<asp:ListItem Value=""></asp:ListItem>									</asp:RadioButtonList>									</td>						</tr>			</table>			<asp:button id="submit" runat="server" Text="Submit" />			</div><!-- end content -->	</form></body></html>

    DISPLAY OUTPUT (just text shows up):TitleIndustryEducation

  3. I wanted to note that I've created several threads in which I did select to receive email notifications ("Enable email notification of replies?"), but I haven't received any. I have to manually go to each post to see if there was a reply. Is there something that I'm missing, or is there a problem with the system? Thanks for any input.

  4. My first suggestion is, stop using Web Matrix...it is outdated and wasn't that good to begin with.Install .net framework 2.0 and download Visual Web Developer Express, it is free fromt he microsoft site. It is much better than Web Matrix.I don't use web matrix so I do not know how to add the reference either.
    I've been thinking of switching to VSE for a bit, so I appreciate your advice. I'll let you know how it goes. Thanks again.
  5. did you add the reference in VS (or VWD)senu1.jpg
    Hi aspnetguy,Sorry that I didn't get back to your question sooner. This forum isn't emailing me even thought I've subscribed to the thread. I'm developing the site using Web Matrix, and I'm not sure how I would add a reference with that...or whether or not I need to. If you could give me more clarification on this, that would be great. Thanks.
  6. I'm a newbie to ASP.NET and VB.NET, and I'm trying to develop a way to include an external script file to a central ASP.NET page. After doing some research, I found information on the ClientScriptManager.RegisterClientScriptInclude Method at http://msdn2.microsoft.com/en-us/library/2552td66.aspx.So this is what I developed for my page:

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %><%@ import Namespace="System.Data" %><%@ import Namespace="System" %><%@ import Namespace="System.IO" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Text.RegularExpressions" %><%@ import Namespace="System.Web.UI" %>Sub Page_Load(sender As Object, e As EventArgs)Dim page_path = page_qs 'Querystring variable unique to each pageDim vbkey As String = page_pathDim vbpath As String = "http://SERVERNAME/DIRECTORY/bgscripts/vb/vbdoc.vb"'Define the name, type and url of the client script on the page.		Dim csname As String = vbkey		Dim csurl As String = vbpath		Dim cstype As Type = Me.GetType()		' Get a ClientScriptManager reference from the Page class.		Dim cs As ClientScriptManager = Page.ClientScript		' Check to see if the include script is already registered.		If (Not cs.IsClientScriptIncludeRegistered(cstype, vbkey)) Then			cs.RegisterClientScriptInclude(cstype, vbkey, ResolveClientUrl(vbpath_new))		End IfEnd Sub

    But I'm receving this error message:Compiler Error Message: BC30002: Type 'ClientScriptManager' is not defined.I made sure to register the namespace at the top of the page (<%@ import Namespace="System.Web.UI" %>), but I'm still getting the same error. If anyone can help me to figure out what I'm doing wrong, that would be great. Thanks.

  7. Ok, I figured out how to do it as soon as I added my last post.This is the solution that worked for me:

    <script runat="server">	Sub Page_Load(sender As Object, e As EventArgs)</script><script runat="server">	'Page code goes here</script><script language="vb" runat="server" src="external.vb" /><script runat="server">	End Sub</script>

    And it worked! The change only resulted in the filesize being 142 bytes greater in size, but I'm not sure if doing it this way will cause any problems. If anyone knows whether or not it will cause problems, please let me know. Thanks.

  8. ASP.Net does still support SSI but recommends using OO style programming instead. This method requires compiling the class into a .dll file. If you are not using VS or do not want ot mess with batch files to get it compiled, you may be able to use <!-- #include file="external.vb" -->
    But I need to include the external document's VB.NET code within the script tag, which I can't do with SSI's. I tried it just for the heck of it, and I received the following error:Parser Error Message: Server includes are not allowed in server script tags.I use Web Matrix for development, so I wouldn't know how to do the other suggestion. If you or anyone else has any other suggestions, I'd love to hear them. Thanks.
  9. I'm a newbie to VB.NET, and I need to know how to call code from an external VB.NET file from within method body. I was thinking something like this:CODE:

    <script runat="server">	Sub Page_Load(sender As Object, e As EventArgs)		'Code for this page		'...some code...		'Code from external VB.NET doc goes here - HOW???	End Sub</script>

    EXTERNAL VB.NET DOC'S CODE:

    Sub hello	headtitle.text = "HELLO WORLD!"End SubIf Not Page.IsPostBack Then	'...some code...End If

    RESULTING CODE:

    <script runat="server">	Sub Page_Load(sender As Object, e As EventArgs)		'Code for this page		'...some code...		'Code from external VB.NET doc		Sub hello			headtitle.text = "HELLO WORLD!"		End Sub		If Not Page.IsPostBack Then			'...some code...		End If	End Sub</script>

    If anyone can show me how to do this, that would be great. Thanks.

  10. I currently have a site that uses ASP.NET, VB.NET, XML, and XSLT using XSL Transformation in ASP.NET. My current method is this:

    <script runat="server">	Sub Page_Load			 'Pull page_qs querystring variable			 Dim page_qs As String = Request.QueryString("page")			 'Load XML file w/page_qs variable selected and assign page properties			 Dim il_xmld As XmlDocument			 Dim il_nodelist As XmlNodeList			 Dim il_node As XmlNode			 'Create the XML Document			 il_xmld = New XmlDocument()			 'Load the Xml file			 il_xmld.Load("links.xml")			 'Get the list of name nodes			 il_nodelist = il_xmld.SelectNodes("/links/page[@id = '" & page_qs & "']")			 'Loop through the nodes			 For Each il_node In il_nodelist				 'Get an Attribute Value			 Dim page_id = il_node.Attributes.GetNamedItem("id").Value				 'Pull XML nodes			 dir_code = il_node.Item("dir_code").InnerText			 subdir1_code = il_node.Item("subdir1_code").InnerText			 subdir2_code = il_node.Item("subdir2_code").InnerText			 'Page path creator			 'If dir is empty			 path_slash = "/"			 If dir_code = "" Then				 dir_path = ""			 Else				 dir_path = dir_code + path_slash			 End If				 'If subdir1 is empty			 If subdir1_code = "" Then				 subdir1_path = ""			 Else				 subdir1_path = subdir1_code + path_slash			 End If				 'If subdir2 is empty			 If subdir2_code = "" Then				 subdir2_path = ""			 Else				 subdir2_path = subdir2_code + path_slash			 End If				 'If page is not empty			 If page_id <> "" Then				 page_path = page_id			 End If			 'Declare XML and XSL file paths			 Dim xmlURL As String, xslURL As String			 xmlURL = "/DIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xml/" + page_path + ".xml"			 xslURL = "/DIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xslt/" + page_path + ".xsl"			 'Assign dynamic url for this page			 xslTransform.DocumentSource = xmlURL			 xslTransform.TransformSource = xslURL				 'Load XML			 Dim xml = Server.CreateObject("MSXML2.DOMDocument.3.0")			 xml.async = false			 xml.load(xmlURL)				 'Load XSL			 Dim xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")			 xsl.async = false			 xsl.load(xslURL)	End Sub</script><html><body>	<form runat="server">		<asp:Xml id="xslTransform" runat="server"></asp:Xml>	</form></body></html>

    But I was wondering, would it be more or less efficient for me to create a function that transforms the XML and XSLT files in the code using the transformNode method by calling the function from a label in the form tag? I guess I'm thinking something like this:

    <script runat="server">	Sub Page_Load		Function webdata			'Pull page_qs querystring variable			Dim page_qs As String = Request.QueryString("page")			'Load XML file w/page_qs variable selected and assign page properties			Dim il_xmld As XmlDocument			'.... SAME AS ABOVE			'Load XML			Dim xml = Server.CreateObject("MSXML2.DOMDocument.3.0")			xml.async = false			xml.load(xmlURL)				'Load XSL			Dim xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")			xsl.async = false			xsl.load(xslURL)			'Transform file			webdata.Text = xml.transformNode(xsl)		End Function	End Sub</script><html><body>	<form runat="server">		<asp:Label id="webdata" runat="server" />	</form></body></html>

    NOTE: Please keep in mind that I'm a newbie to all of this, so I realize that my logic may not be correct in the second example.Or is the difference so minor that it doesn't matter? I'd greatly appreciate some input on this. Thanks for any advice.

  11. Well, I solved this one after further research and testing. I just needed to assign the form field xmlTransorm within the code of the document to retain a dynamic page. So this is what I did:

    <script language="VB" runat="server">Dim xmlURL As String, xslURL As StringxmlURL = "/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xml/" + page_path + ".xml"xslURL = "/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xslt/" + page_path + ".xsl"'Assign dynamic urlS for this pagexslTransform.DocumentSource = xmlURLxslTransform.TransformSource = xslURL</script><html><body><form runat="server"> <asp:Xml id="xslTransform" runat="server"></asp:Xml></form></body></html>

    ...and it worked great. There's a great online article that comes from the book "XSLT for ASP.NET" that talks about this at http://www.topxml.com/dotnet/articles/xslt/default.asp. Even thought I code in VB.NET, and this book uses C# for its examples, I definitely intend to get this book.

  12. I'm trying to convert an ASP page that uses XML/XSLT Transformation into an ASP.NET page that uses the same transformation. The old ASP page was like this:

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" aspcompat="true" Debug="true" %><%@ OutputCache Duration="10" VaryByParam="*"%><%@ import Namespace="System.Data" %><%@ import Namespace="System" %><%@ import Namespace="System.IO" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Text.RegularExpressions" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%'Declare querystring variablesDim page As String = Request.QueryString("page")Dim dir As String = Request.QueryString("dir")Dim subdir1 As String = Request.QueryString("subdir1")Dim subdir2 As String = Request.QueryString("subdir2")Dim subleftnav As String = Request.QueryString("subleftnav")%><%'Path separaterDim path_slash As String = "/"'Declare transformed variablesDim page_path As String, dir_path As String, subdir1_path As String, subdir2_path As String'If dir is emptyIf dir = "" Thendir_path = ""Elsedir_path = dir + path_slashEnd If'If subdir1 is emptyIf subdir1 = "" Thensubdir1_path = ""Elsesubdir1_path = subdir1 + path_slashEnd If'If subdir2 is emptyIf subdir2 = "" Thensubdir2_path = ""Elsesubdir2_path = subdir2 + path_slashEnd If'If page is not emptyIf page <> "" Thenpage_path = pageEnd If%><%'Declare XML and XSL file pathsDim xmlURL As String, xslURL As StringxmlURL = "http://SERVERNAME/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xml/" + page_path + ".xml"xslURL = "http://SERVERNAME/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xslt/" + page_path + ".xsl"'Test'Response.Write(xmlURL + "<br />" + xslURL)%><%'Load XML'Dim xml = Server.CreateObject("Microsoft.XMLDOM") 'DELETE LATERDim xml = Server.CreateObject("MSXML2.DOMDocument.3.0")xml.async = falsexml.load(xmlURL)'Load XSL'Dim xsl = Server.CreateObject("Microsoft.XMLDOM") 'DELETE LATERDim xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")xsl.async = falsexsl.load(xslURL)'Transform fileResponse.Write(xml.transformNode(xsl))%>

    ...and the new ASP.NET page I've developed is so far like this:

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %><%@ import Namespace="System.Data" %><%@ import Namespace="System" %><%@ import Namespace="System.IO" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Text.RegularExpressions" %><script runat="server">	Sub Page_Load		'To import XML/XSLT Transformation using DOM		'Declare querystring variables		Dim page As String = Request.QueryString("page")		Dim dir As String = Request.QueryString("dir")		Dim subdir1 As String = Request.QueryString("subdir1")		Dim subdir2 As String = Request.QueryString("subdir2")		Dim subleftnav As String = Request.QueryString("subleftnav")		'Path separater		Dim path_slash As String = "/"		'Declare transformed variables		Dim page_path As String, dir_path As String, subdir1_path As String, subdir2_path As String		'If dir is empty		If dir = "" Then		dir_path = ""		Else		dir_path = dir + path_slash		End If		'If subdir1 is empty		If subdir1 = "" Then		subdir1_path = ""		Else		subdir1_path = subdir1 + path_slash		End If		'If subdir2 is empty		If subdir2 = "" Then		subdir2_path = ""		Else		subdir2_path = subdir2 + path_slash		End If		'If page is not empty		If page <> "" Then		page_path = page		End If		'Declare XML and XSL file paths		Dim xmlURL As String, xslURL As String		xmlURL = "http://SERVERNAME/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xml/" + page_path + ".xml"		xslURL = "http://SERVERNAME/MAINDIRECTORY/" + dir_path + subdir1_path + subdir2_path + "docs/xslt/" + page_path + ".xsl"		'Response.Write(xmlURL + "<br />" + xslURL) 'Test		'Load XML		'Dim xml = Server.CreateObject("Microsoft.XMLDOM") 'DELETE LATER		Dim xml = Server.CreateObject("MSXML2.DOMDocument.3.0")		xml.async = false		xml.load(xmlURL)		'Load XSL		'Dim xsl = Server.CreateObject("Microsoft.XMLDOM") 'DELETE LATER		Dim xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")		xsl.async = false		xsl.load(xslURL)		'Transform file		'Response.Write(xml.transformNode(xsl)) 'This method DOES work	End Sub</script><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head></head><body>	<form runat="server">		<asp:Xml id="xslTransform" runat="server" DocumentSource="<%=(xmlURL)%>" TransformSource="<%=(xslURL)%>"></asp:Xml>	</form><!-- This method DOES NOT work --></body></html>

    When I use this property to transform the 2 files:

    'Transform file		'Response.Write(xml.transformNode(xsl))

    ...it comes through fine.But when I attempt to use this method to transform the 2 files:

    <form runat="server">		<asp:Xml id="xslTransform" runat="server" DocumentSource="<%=(xmlURL)%>" TransformSource="<%=(xslURL)%>"></asp:Xml>	</form>

    ...I receive this error message: Exception Details: System.ArgumentException: Illegal characters in path.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.I'm wanting to use the second method because I want to load the data directly in the <body> tag of the page. If anyone can see what I'm doing wrong, and let me know how to correct it, that would be greatly appreciated. Thanks.

  13. I've created a new site that uses ASP.NET and XML with the help of Web Matrix. I've really appreciated how light and easy-to-use the Web Matrix has been. But some downsides that I've discovered are not much support and no training, as everything's set up for Visual Studio.NET users.So my question is, what are the pro's and con's to using Web Matrix or Visual Web Developer Express in ASP.NET development? Thanks for any advice.

  14. I have a page that's written in ASP with VB syntax. I'd like to create a script or function that redirects the user to a logoff page before their session.timeout = 0. That's because the logoff page will add a 'False' flag to a DB table in SQL Server 2k with the use of their AccountID. Does anyone know of an easy way to do this? Thanks for any help.

  15. Hi aspnetguy,I had a chance to look at FormsAuthentication, and it looks like it will be a good solution for future projects. But unfortunately I have a deadline for this project of next Friday, and I'm still running into the same problems with sessions. So I thought that I'd try again...Basically, the session variables are timing out before the session.timeout and session.sessionid methods have timed out. So this is the scenario:On initial login:Session("Group") = "A"Session.Timeout = 20Session.SessionID = a bunch of codeAfter 20 minutes of activity:Session("Group") = ""Session.Timeout = 20Session.SessionID = a bunch of codeThe session.timeout and session.sessionid variables are staying active properly, but the session("Group") variable is timing out on it's own even though the page is being refreshed by the user (me).I also tried changing the web.config file itself to set the sessionState, like this:<configuration> <appSettings> </appSettings> <system.web> <customErrors mode="Off" /> <SessionState timeout="20" /> </system.web></configuration>...but I received this error message: Runtime ErrorDescription: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>...but I already have the "customErrors" set to "Off", so I'm not sure why I'm getting this error message.Has anyone run into these issues, and if so, is there a solution for it? My operating system is Windows XP, and my test server is running IIS6 if that makes any difference. Thanks for any help.

  16. 1) yes it si possible. It isn't any less secure either way. Red Gate has some really awesome tools for syncronizing database structures and content between servers.

    That's good to know, but I'd really like to avoid using a 3rd-party vendor, as we are a local government, and it's not easy to get those approved. So if I was to set this up on my own with a DTS pkg, how secure would that be? That seems like it could open up a small hole for any possible hackers.
  17. First off, I'm using SQL Server 2k for the backend and ASP.NET/VB.NET for the front-end.A few questions were posed to me by my boss, and I'd like to get some constructive advice on what he's requesting, and what my answers were to him. Ok, here they are:1) Data Export from Internet Server to Intranet ServerCurrent Setup: We have 2 copies of each table. One is on the web server for display-purposes only, and another is on the internal server where editing is done through front-ends. Boss's Suggested Setup: He wants to have 1 copy of each table that resides on the internal server, and set up jobs to export certain data from the web server to the internal server.My View: I think that if this is possible, it's not a good idea to do for security reasons. I think that it would just open us up to possible hacking directly onto our internal server.Questions:Can you export data from the web server to the internal server when data is edited on the web server?If so, how secure is it to have that setup?2) Encryption/DecryptionDescription of Situation: We currently have a DB table that contains a password column that's not encrypted. My boss wants to encrypt that column directly in the DB table. I researched the subject at this and other forums, and read several accounts about how difficult it is to use encryption within SQL Server. I read from several sources that the two functions used by some (pwdencrypt and pwdcompare) are not supported by Microsoft, so you're on your own if you have any problems. Also, I read that some developers had problems when they upgraded to a newer version of SQL Server.Questions:1) Which setup is better with excryption/decryption:A) Doing it within SQL Server 2k:) Doing it on the front-end with the keys stored in a secure directoryMy View: I'd only like to use a solution within SQL Server that doesn't run into the previosly mentioned set of problems. If there is no way to accomplish this, I think that it would be better to do the encryption/decryption on the application's side of things.Ok, that should do it. I hope to hear some good advice. Thanks.

  18. Ok, after some further testing, I've found the problem. It's actually unrelated to the query that we've been using, so that's why I was getting a different result. The entire query contains 3 tables with inner joins, and one of the tables doesn't have data for this property, so it affects the entire query.This is the entire query that I have:SELECT T1.Col1, T1.Col2, T1.Col3, T2.Col1, T2.Col2, T2.Col3, T3.Col1, T3.Col2, T3.Col3FROM TABLE1 T1 INNER JOIN TABLE2 T2 ON T1.Col1 = T2.Col1 INNER JOIN TABLE3 T3 ON T1.Col1 = T3.Col1WHERE (T1.Col1 LIKE '15%') AND (T1.Col2 LIKE 'ACORN LN%') AND (T1.Col3 = '2006')ORDER BY T1.Col1I know that it's a bit confusing, but basically Table3 is empty for this property, so no records show up at all on this query. So within a SQL query, is there a way to use a table with inner joins on tables that may or may not have data within them, because I'm not sure how to do that being a newbie to SP's. Sorry for the mis-direction.

  19. I have a stored procedure that gets called from an ASP/VB syntax front-end, and a SQL Server 2k back-end, and I'm running into a problem with the results. Basically, I'm trying to get block data from around an address. But I get two records when I should get 4 records.Below is the code that I have so far. When I do this either through the front-end or directly through the SQL Server Query Analyzer, I get partial results. But when I do this manually through SQL Server, I'm able to get the proper results. I'm stumped, so I'd greatly appreciate any help. Thanks.1) FRONT-END:'Declare variablesDim strStreetNbr_db As String = Session("StreetNbrDb")Dim strDefaultYear As String = "2006"Dim strStreetNbr_db_b As String, strPlate_reblock As String, objKillQuery As Object'Pull in form ValuesDim strVar1 As String, strVar2 As String, strVar3 As String'Manipulate form ValuesIf objForm1 = True Then 'Assign variables strStreetNbr_db As String = Trim(Request.Form("strnbr") '***NOTE: Result is "1519" (without quotes)*** strStreetName_db As String = Trim(Request.Form("strname") '***NOTE: Result is "ACORN LN" (without quotes)*** strYear As String = strDefaultYear '***NOTE: Result is "2006" (without quotes)*** 'Determine length of address number Select Case Len(strStreetNbr_db) Case "1" strStreetNbr_db = "" strStreetNbr_db_b = "_" Case "2" strStreetNbr_db = "" strStreetNbr_db_b = "__" Case "3" strStreetNbr_db = Left(strStreetNbr_db, 1) strStreetNbr_db_b = strStreetNbr_db & "%" Case "4" strStreetNbr_db = Left(strStreetNbr_db, 2) strStreetNbr_db_b = strStreetNbr_db & "%" Case "5" strStreetNbr_db = Left(strStreetNbr_db, 3) strStreetNbr_db_b = strStreetNbr_db & "%" Case Else objKillQuery = True End Select '***NOTE: Result is "15%" (without quotes)*** 'Display data Response.Write("<table class='medbeborder' width='100%'>") Response.Write("<tr class='medbeheader' colspan='5'>") Response.Write("<td align='center'>Street #</td>") Response.Write("<td align='center'>Street Name</td>") Response.Write("<td align='center'>Year</td>") Response.Write("</tr>") If objKillQuery <> True Then '------------------Block Query Begins--------------------- Dim sqlBlockQuery As Object, rsBlockQuery As Object objConn = Server.CreateObject("ADODB.Connection") objConn.Open (strConnLandUse) sqlBlockQuery = "spBlock @Par1 = '" & strStreetNbr_db_b & "', @Par2 = '" & strStreetName_db & "', @Par3 = '" & strDefaultYear & "'" rsBlockQuery = objConn.Execute(sqlBlockQuery) 'Response.Write("sqlBlockQuery & "<br />") 'TEST '***NOTE: Result is spBlock @Par1 = '15%', @Par2 = 'ACORN LN', @Par3 = '2006' *** If NOT rsBlockQuery.EOF Then 'If RS is not empty Do While NOT rsBlockQuery.EOF 'Begin loop intRecordCount = intRecordCount + 1 'Record counter If intRecordCount > 200 Then Exit Do 'Exit from infinite loop If intRecordCount <= 200 Then 'Display results (under 200 records) Response.Write("<td align='center'>" & Trim(rsBlockQuery("StrNbr").Value.ToString) & "</td>") Response.Write("<td align='center'>" & Trim(rsBlockQuery("StrName").Value.ToString) & "</td>") Response.Write("<td align='center'>" & Trim(rsBlockQuery("Year").Value.ToString) & "</td>") Response.Write("</tr>") End If rsBlockQuery.MoveNext Loop 'End loop Do While NOT rsBlockQuery.EOF End If sqlBlockQuery = nothing rsBlockQuery = nothing objConn.Close objConn = nothing intRecordCount = 0 'Reset record counter '------------------Block Query Ends----------------------- End If 'End If objKillQuery <> True Response.Write("</table>")End If 'End objForm1 = True2) BACKEND:Stored Procedure:CREATE PROCEDURE [dbo].[spBlock]@Par1 varchar (13),@Par2 varchar (24),@Par3 varchar (4)ASSET NOCOUNT ONSELECT *FROM tblBlockWHERE Col1 LIKE @Par1 AND Col2 LIKE @Par2 AND Year = @Par3ORDER BY Col1 ASCSET NOCOUNT OFFGOResulting Stored Procedure on Front-End:spBlock @Par1 = '15%', @Par2 = 'ACORN LN', @Par3 = '2006'(NOTE: Results in partial data - 2 records)Manual Query of Same Data:SELECT *FROM tblBlockWHERE (Col1 LIKE '15%') AND (Col2 = 'ACORN LN') AND (Col3 = '2006')(NOTE: Results in correct data - 4 records)

  20. ...BTW, What were you using Sessions for? If it is for login you could try FormsAuthentication. It is more secure and it doesn't expire unless you tell it too
    I'm using Sessions throughout the site to store the user's SessionID, AccountID, and GroupID. We use all of these sessions to give users specific rights to sections of the site, and to set the proper navigation. We also insert the SessionID into a DB table to authentification of an external application, so we couldn't use the "FormsAuthentication" option that you mentioned for that. But I'll definitely look into it in the future for internal form authentification. I did try the suggested change to the web.config file like this:<configuration> <system.web> <customErrors mode="Off" /> <sessionState timeout="20" /> </system.web></configuration>...but I received the following error message:Server Error in '/' Application.Runtime ErrorDescription: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>I'm new to using the web.config file, so do you know what I should do next? I appreciate your help:)
  21. Try setting the session timeout value in the web.config file<sessionStatemode=""stateConnectionString="tcpip="sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"cookieless="false"timeout="20"/>
    I'll give this a try. That's just too bad that it doesn't work as it should.
    I have run in this problem time and time again and I must say I have never found a sure-fire solution.Make sure you are not setting the timeout on multiple pages. In some cases the new tiomeout setting ends the current session.
    Yeah, I think it's strange also. I never had this problem with ASP applications. I made sure that there are no other Session.Timeout's throughout the site besides the main one, but it's still acting strangly. I'll give pulpfiction's option a try, and I'll let you know if it works for me. Thanks for the replies.
×
×
  • Create New...