Click here to Skip to main content
15,902,889 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: textbox does not begin with the number Pin
Member 1032497423-Jun-14 7:24
Member 1032497423-Jun-14 7:24 
GeneralRe: textbox does not begin with the number Pin
Richard Deeming23-Jun-14 11:19
mveRichard Deeming23-Jun-14 11:19 
AnswerRe: textbox does not begin with the number Pin
Sibeesh KV29-Sep-14 1:53
professionalSibeesh KV29-Sep-14 1:53 
QuestionRe: How to get values from dynamically created controls Pin
Member 1089879721-Jun-14 19:12
Member 1089879721-Jun-14 19:12 
QuestionCheckboxlist combobox in Asp.net Pin
Elham M21-Jun-14 18:10
Elham M21-Jun-14 18:10 
AnswerRe: Checkboxlist combobox in Asp.net Pin
thatraja21-Jun-14 18:27
professionalthatraja21-Jun-14 18:27 
GeneralRe: Checkboxlist combobox in Asp.net Pin
Elham M28-Jun-14 21:25
Elham M28-Jun-14 21:25 
QuestionRemoving a Sub Page_Load()? Pin
Member 876166721-Jun-14 15:05
Member 876166721-Jun-14 15:05 
Hello

I have three files in my simple 'Registration form' project - it inserts new user details into a MS Access database - comprising
an aspx, aspx.vb, and a Web.config file.

If I may post some of the code here, I was wondering if I can delete the following Sub Page_Load() from my aspx.vb file since I
can't see the purpose of it. In that aspx.vb file, I have:

Sub Page_Load()

        Dim myMDBConnection As OleDbConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("Register").ToString().Trim())
        myMDBConnection.Open()
        'do stuff here
        myMDBConnection.Close()
    End Sub


    Protected Sub CreateUser_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\myDatabase.mdb;")
        Using conn

            Dim Sql As String = "INSERT INTO userlist (username,password, strEmail) VALUES (@username,@password, @strEmail)"
            Dim cmd As New OleDbCommand(Sql, conn)
            conn.Open()
            cmd.Parameters.AddWithValue("@username", username.Text)
            cmd.Parameters.AddWithValue("@password", password.Text)
            cmd.Parameters.AddWithValue("@strEmail", strEmail.Text)
            cmd.ExecuteNonQuery()
            conn.Close()

        End Using
    End Sub

End Class


And in my Web.config file I have:

<?xml version="1.0"?>

    <configuration>
      <connectionStrings>       
          
            <add name="Register" providerName="Microsoft.Jet.OLEDB.4.0;" 
                 connectionString="C:\myDatabase.mdb;" />
     
          </connectionStrings>
     </configuration>


Would it be 'safe' to remove that Sub Page_Load()?

Thank you for any advice.
AnswerRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 10:39
professionaljkirkerx23-Jun-14 10:39 
AnswerRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 11:16
Member 876166723-Jun-14 11:16 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 11:40
professionaljkirkerx23-Jun-14 11:40 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 12:01
Member 876166723-Jun-14 12:01 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 13:03
professionaljkirkerx23-Jun-14 13:03 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 14:18
Member 876166723-Jun-14 14:18 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 16:02
professionaljkirkerx23-Jun-14 16:02 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 16:23
Member 876166723-Jun-14 16:23 
QuestionThe connection String property has not been initialized? Error Pin
Inayat ali jan21-Jun-14 8:45
Inayat ali jan21-Jun-14 8:45 
AnswerRe: The connection String property has not been initialized? Error Pin
Member 1089879721-Jun-14 19:47
Member 1089879721-Jun-14 19:47 
QuestionMVC Razor: Getting a user id stored in Entity Framework when calling the Controller that Display Profile View. Pin
Stephen Holdorf21-Jun-14 7:57
Stephen Holdorf21-Jun-14 7:57 
QuestionMVC Razor: Dynamically displaying and hiding UI text controls in the parent View and it's partial Views. Pin
Stephen Holdorf21-Jun-14 7:43
Stephen Holdorf21-Jun-14 7:43 
Questionmsbuild with no Visual Studio (Yes Windows SDK installed & Copy Local=true) Pin
devvvy20-Jun-14 11:26
devvvy20-Jun-14 11:26 
QuestionStore gridview selected row values in sessions Pin
hilbiazhar20-Jun-14 1:49
hilbiazhar20-Jun-14 1:49 
AnswerRe: Store gridview selected row values in sessions Pin
Deflinek20-Jun-14 9:02
Deflinek20-Jun-14 9:02 
QuestionHow to send a mail from local SMTP server. Pin
Kandepu Rajesh18-Jun-14 11:18
Kandepu Rajesh18-Jun-14 11:18 
SuggestionRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan18-Jun-14 22:35
mveRichard MacCutchan18-Jun-14 22:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.