|
|
Hi,
I using .NET 2.0. I want to use a cust create user control, but I am struggling to change the text of the default button from Create User to Register. Please can someone advise me on how to do this.
Also, where does the user get added to the user membership tables??
I hope someone can help?
Regards
ma se
|
|
|
|
|
set CreateUserButtonText property to "Register"
<< >>
|
|
|
|
|
Hello Everyone,
I am trying to have my site connect to a database a check for an email address but when it goes to open the database I receive an error.
Here is the code up until I receive the error. Can anyone see if I am missing something?
Imports System
Imports System.Data
Imports System.Data.SqlClient
Partial Class login
Inherits System.Web.UI.Page
Private Function emailCheck() As Boolean
Dim conCED As SqlConnection
Dim cmdSelect As SqlCommand
Dim dtrLogin As SqlDataReader
Dim path As String
Dim provider As String
path = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DatabaseSQL.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
provider = "Database=DatabaseSQL;"
conCED = New SqlConnection(provider & path)
conCED.Open()
On the conCED.Open() I get this error message.
The header for file 'e:\wwwdata\56b549be\www\App_Data\DatabaseSQL.mdf' is not a valid database file header. The FILE SIZE property is incorrect.
Could not attach file 'e:\wwwdata\56b549be\www\App_Data\DatabaseSQL.mdf' as database 'DatabaseSQL'
Thanks for the help
Chad Dolan
|
|
|
|
|
Just to make sure to verity if DB is ok or not...can you open your DB thru SQL enterprise?
<< >>
|
|
|
|
|
I think you are right there is a problem with the DB.
Thanks for the help.
Chad Dolan
|
|
|
|
|
Hi everybody...
I have some problems related to a querystring issue.
I`m calling an ASPX page, with some querystring parameters, from a JavaScript function, through the window.open method.
The way this URL is configured and called in the javascript function is the following: EnviarMapaEmail.aspx?type=addPt&x=-46.644203856241546&y=-23.571182563934798&st=Av.%20Paulista&nb=10&city=S%C3O%20PAULO&uf=SP&POI=
And in the ASPX page, the Request.QueryString comes this way:
type=addPt&x=-46.644203856241546&y=-23.571182563934798&st=Av.+Paulista&nb=10&city=SO+PAULO&uf=SP&POI=
The problem is: the original city name (city parameter) is 'SÃO PAULO' and it`s encoded in the URL (thought the escape() javascript function) as 'S%C3O%20PAULO', but my ASPX page only recognize'SO+PAULO' and it goes back through the Request.QueryString as 'SO PAULO'.
What`s the problem in encoding especial chars?
Any hint would be very appreciated... :]
See you!
|
|
|
|
|
AFAIK, the settings that decide how the escaped codes in the request are decoded are:
:: The content-type setting in the html header, which probably comes from:
:: The content-type meta tag in the sending page.
:: The RequestEncoding setting in the web.config file.
Also, the escape function might not take into account the selected encoding for the page. Try the newer encodeURIComponent function instead.
---
single minded; short sighted; long gone;
|
|
|
|
|
hey guffa...
thank you, it worked.
both pages are .aspx, so, presumably, they`re using the same encoding type.
but your hint about the encodeURIComponent function worked fine, both on IE and FF.
cya
|
|
|
|
|
Hello,
How can I make an ASP.Net page execute a certain function every 30 minutes ?
tnX...
|
|
|
|
|
Java Script:
===========
function setTimeInterval()
{
var Timer = setInterval("fun()", 30*1000); //For every 30 minutes fun() will be executed.
}
function fun()
{
Ur Code Here
}
<body onLoad="setTimeInterval()">
Regards,
Arun Kumar.A
|
|
|
|
|
other way...
<!-- Refresh page after 10 seconds --><br />
<meta http-equiv="refresh" content="10" />
<< >>
|
|
|
|
|
Hi Al,
Manoj Bisht this side. Can anybody let me know how to deploy an web application in ASP.NET and also is it necessary to include the database(Sql Server2000) while deploying the web application if yes how it can be
.....................
Plz
|
|
|
|
|
The Knowledge wrote: how to deploy an web application in ASP.NET and also is it necessary to include the database(Sql Server2000) while deploying the web application
Assume that you are deploying to remote server. Copy all aspx files, and config files. Copy bin folder also which contains all dll's. SQL DB can be deployed as a .SQL file.
|
|
|
|
|
Hi all,
Can anybody let me know how to include the splash screen in ASP.NET(Web Based)
or in javascript as well
...............................
Manoj Bisht
|
|
|
|
|
hello
who r u?
do u know who am i.
the big legend there.
byee
tc
|
|
|
|
|
Stop spamming the site...
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
well.. i guess there aint any splash screen functionality inbuilt into ASP.net, though u can set it running using some javacript tweaks..
create an initial page and add the splash screen content in it.. use the setinterval() javascript function to redirect to another page after a set time interval.
or u may even use AJAX so that the content is displayed on the same page..
i hope u get it
Kunal
|
|
|
|
|
|
I read a boolean value from a table with this:
Public SQLconn As New SqlConnection(ConfigurationManager.ConnectionStrings("TestConnectionString").ToString())
Sub Page_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SELECT value1 from table1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Boolean
Dim myDataReader As SqlDataReader
myDataReader = SelectCmd.ExecuteReader()
myDataReader.Read()
result = myDataReader1.GetBoolean(0)
SQLconn.Close()
ChangeButton1(result1)
End Sub
Is it possible to read values from two tables or more with the same method and if not what can I do?
I tried this:
Dim SelectCmd1 As New SqlCommand("SELECT value1.table1, value2.table2 FROM table1, table2", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Boolean
[b]Dim result2 As Boolean[/b]
Dim myDataReader As SqlDataReader
myDataReader = SelectCmd1.ExecuteReader()
myDataReader.Read()
result1 = myDataReader.GetBoolean(0)
[b]result2 = myDataReader.GetBoolean(1)[/b]
SQLconn.Close()
ChangeButton(result1, result2)
End Sub
Could this work????
Any help will be much appreciated!!!
|
|
|
|
|
If you are using .net 2.0 then ado supports MARS (multiple result sets). Here is some sample code from MS help:
' Assumes that connection is a valid SqlConnection object.
Dim command As SqlCommand = New SqlCommand( _
"SELECT CategoryID, CategoryName FROM dbo.Categories;" & _
"SELECT EmployeeID, LastName FROM dbo.Employees", connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
Dim nextResult As Boolean = True
Do Until Not nextResult
Console.WriteLine(vbTab & reader.GetName(0) & vbTab & reader.GetName(1))
Do While reader.Read()
Console.WriteLine(vbTab & reader.GetInt32(0) & vbTab & reader.GetString(1))
Loop
nextResult = reader.NextResult()
Loop
reader.Close()
connection.Close()
Hope that helps.
Ben
|
|
|
|
|
hi,
This will not work.
The qurey provided by you will return table1.rowcount * table2.rowcount number of recored.
Can you please specify why you want data from both table and what is the actual requirment?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
@kubben I will check it
@Chetan
I have a hardware device that is connected to a sql database. I also have 7 switches connected to this device. So every time I toggle the boolean value(press button event in asp.net page) I turn on or off the corresponding switch. I use Page_load to initialize the button controls. Every switch is connected to a table with on one record that I update from the page.
The whole code for "one" button looks like this:
Public SQLconn As New SqlConnection(ConfigurationManager.ConnectionStrings("TestConnectionString").ToString())
Sub Page_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SELECT rawvalue FROM switch1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Boolean
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetBoolean(0)
SQLconn.Close()
ChangeButton1(result1)
End Sub
Sub ChangeButton1(ByVal Status As Boolean)
If Status Then
Label1.Text = "ON"
OnOff1.Style.Value = "background-image: url(../ImgContr/1.png);"
Else
Label1.Text = "OFF"
OnOff1.Style.Value = "background-image: url(../ImgContr/2.png);"
End If
End Sub
Sub OnOff_Click1(ByVal Sender As Object, ByVal e As System.EventArgs)
Dim updateCMD As SqlCommand
Dim query As String
If Label1.Text = "ON" Then
query = "UPDATE [switch1] SET [rawvalue] = 'False' WHERE [device] = 'channel1'"
ChangeButton1(0)
Else
query = "UPDATE [switch1] SET [rawvalue] = 'True' WHERE [device] = 'channel1'"
ChangeButton1(1)
End If
updateCMD = New SqlCommand(query, SQLconn)
updateCMD.CommandType = CommandType.Text
SQLconn.Open()
updateCMD.ExecuteNonQuery()
SQLconn.Close()
End Sub
It works for 7 switches too but I have to write every SUB 7 times.
And the initialization looks like this:
Sub Page_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("prodiakoptis1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Boolean
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetBoolean(0)
SQLconn.Close()
SQLconn.Open()
Dim SelectCmd2 As New SqlCommand("prodiakoptis2", SQLconn)
SelectCmd2.CommandType = CommandType.StoredProcedure
Dim result2 As Boolean
Dim myDataReader2 As SqlDataReader
myDataReader2 = SelectCmd2.ExecuteReader()
myDataReader2.Read()
result2 = myDataReader2.GetBoolean(0)
SQLconn.Close()
|
|
|
|
|
Hi,
First of all you dont need to open and close the connection everytime you are calling new stored procedure.
You can create only one stored procedure which will return all the values u need in the form of output parameters. Remeber this is advisable only if your number of switches is not going to change in future.
You must be familier with how to create and execute stored procedure with output parameters.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I actualy created a SP to retrieve the data from the tables.
ALTER PROCEDURE dbo.switch1
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
AS
SELECT [rawvalue] FROM [switch1]
/* SET NOCOUNT ON */
RETURN
I have one SP for every table.
Even if I create a SP what I don't know is how to read all this values with the datareader.
|
|
|
|