CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Problems creating sessions from sql query

Print topic Send  topic

Author Message
drpcken

Posts: 60
Posted: 08/18/2004, 12:49 PM

Hey, I'm creating a session inside my code, but for some reason I keep getting publishing errors. It queries SQL and builds a select statement based on the value of the textbox 'login'. Here's my code:

  
'Control login Event OnValidate. Action Custom Code @8-73254650  
    ' -------------------------  
   		Dim sqlConn as New SqlClient.SqlConnection("server=(local);uid=sa;pwd=;initial catalog=IFPAWEB")  
		Dim sqlComm as New SqlClient.SqlCommand()  
		Dim sLogin as String  
			  
	  
  
		sqlConn.Open()  
		With sqlComm  
			.connection = sqlConn  
			.CommandType = CommandType.Text  
			.CommandText = "Select UserName from UserSecurity where UserID='" + login + "'"  
		End With  
  
		System.Web.HttpContext.Current.Session.Add("SessionName", sqlComm.ExecuteScalar)  
		SqlConn.Close()  
    ' -------------------------  
'End Control login Event OnValidate. Action Custom Code  

and when I try to publish it, I get
C:\DOCUME~1\ADMINI~1.000\LOCALS~1\Temp\~IFPAWEB>C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\vbc /rootnamespace:IFPAWEB /t:library /out:bin\IFPAWEB.dll /imports:Microsoft.VisualBasic,System,System.Web,System.Xml,System.Data,System.Drawing /r:Microsoft.VisualBasic.dll,System.dll,System.Web.dll,System.Xml.dll,System.Data.dll,System.Drawing.dll /recurse:*.vb

Microsoft (R) Visual Basic .NET Compiler version 7.00.9466

for Microsoft (R) .NET Framework version 1.00.3705.288

Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.



C:\DOCUME~1\ADMINI~1.000\LOCALS~1\Temp\~IFPAWEB\components\LoginDataProvider.vb(157) : error BC30452: Operator '+' is not defined for types 'String' and 'IFPAWEB.Data.TextField'.



.CommandText = "Select UserName from UserSecurity where UserID='" + login + "'"


This code works fine in my normal compiler, but I can't figure why its acting up here. WHen I replace the + login + with a static value, the session works fine.

THANKS!
View profile  Send private message
drpcken

Posts: 60
Posted: 08/18/2004, 2:03 PM

RESOLVED!

login.value

;-)

Thanks!!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.