Click here to Skip to main content
15,921,884 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionExtracting Numbers From Other Text Pin
Brendan Vogt21-Aug-07 21:42
Brendan Vogt21-Aug-07 21:42 
AnswerRe: Extracting Numbers From Other Text Pin
greekius21-Aug-07 22:26
greekius21-Aug-07 22:26 
QuestionData Grid .. Pin
nandhububbly21-Aug-07 21:42
nandhububbly21-Aug-07 21:42 
AnswerRe: Data Grid .. Pin
Christian Graus21-Aug-07 21:55
protectorChristian Graus21-Aug-07 21:55 
GeneralRe: Data Grid .. Pin
nandhububbly21-Aug-07 22:56
nandhububbly21-Aug-07 22:56 
QuestionAccess to the path 'c:\inetpub\wwwroot\FinalUploadProgress\web.config' is denied. Pin
-- Abhi --21-Aug-07 21:40
-- Abhi --21-Aug-07 21:40 
AnswerRe: Access to the path 'c:\inetpub\wwwroot\FinalUploadProgress\web.config' is denied. Pin
greekius21-Aug-07 22:12
greekius21-Aug-07 22:12 
QuestionSimple connection - What is wrong With This code? Pin
greekius21-Aug-07 21:26
greekius21-Aug-07 21:26 
This code block is run on my developer pc. but i upload files to server then
I get an error "Object reference not set to an instance of an object"
on "dr.close"

whats wrong with this code?

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate

Dim conn As New System.Data.OleDb.OleDbConnection(MyConstants.sqlConnString)<br />
       Dim cmd As New System.Data.OleDb.OleDbCommand("", conn)<br />
       Dim dr As System.Data.OleDb.OleDbDataReader<br />
       Dim msG As String = ""<br />
       Try<br />
           conn.Open()<br />
           cmd.CommandText = "SELECT * FROM  MD_USERS WHERE U_USERNAME='" & Login1.UserName & "' AND U_PASSWORD='" & Login1.Password & "' "<br />
           dr = cmd.ExecuteReader<br />
           If dr.Read Then<br />
               Dim mu As New MyUser<br />
               mu._ID = dr.Item("U_ID")<br />
               mu._Name = dr.Item("U_CLASS") & " " & Myuser.SayDignity(dr.Item("U_DIGNITY")) & " " & dr.Item("U_NAME") & " " & dr.Item("U_SURNAME")<br />
               mu._CATEGORY = dr.Item("U_CATEGORY")<br />
               mu._AUTHORITY = dr.Item("U_AUTHORITY")<br />
               Session("MYUSER") = mu<br />
               e.Authenticated = True<br />
           End If<br />
       Catch ex As Exception<br />
           msG = ex.Message<br />
       Finally<br />
           dr.Close()<br />
           conn.Close()<br />
       End Try<br />
       If Not msj = "" Then<br />
           Session("msG") = msG<br />
           Response.Redirect("Messages.aspx")<br />
       End If<br />
   End Sub


also What do u offer to improve this code?
AnswerRe: Simple connection - What is wrong With This code? Pin
Michael Sync21-Aug-07 21:30
Michael Sync21-Aug-07 21:30 
AnswerRe: Simple connection - What is wrong With This code? Pin
Parwej Ahamad21-Aug-07 21:30
professionalParwej Ahamad21-Aug-07 21:30 
AnswerRe: Simple connection - What is wrong With This code? Pin
N a v a n e e t h21-Aug-07 21:34
N a v a n e e t h21-Aug-07 21:34 
GeneralRe: Simple connection - What is wrong With This code? Pin
N a v a n e e t h21-Aug-07 21:36
N a v a n e e t h21-Aug-07 21:36 
GeneralRe: Simple connection - What is wrong With This code? Pin
Parwej Ahamad21-Aug-07 21:43
professionalParwej Ahamad21-Aug-07 21:43 
GeneralRe: Simple connection - What is wrong With This code? Pin
N a v a n e e t h21-Aug-07 22:02
N a v a n e e t h21-Aug-07 22:02 
GeneralRe: Simple connection - What is wrong With This code? Pin
Parwej Ahamad21-Aug-07 22:08
professionalParwej Ahamad21-Aug-07 22:08 
GeneralRe: Simple connection - What is wrong With This code? Pin
greekius21-Aug-07 22:16
greekius21-Aug-07 22:16 
QuestionEnable-Disable web.config section. Pin
-- Abhi --21-Aug-07 21:19
-- Abhi --21-Aug-07 21:19 
AnswerRe: Enable-Disable web.config section. Pin
SimulationofSai21-Aug-07 22:35
SimulationofSai21-Aug-07 22:35 
GeneralRe: Enable-Disable web.config section. Pin
-- Abhi --21-Aug-07 23:08
-- Abhi --21-Aug-07 23:08 
QuestionOut parameter from Stored procedure [modified] Pin
manowj21-Aug-07 20:53
manowj21-Aug-07 20:53 
AnswerRe: Out parameter from Stored procedure Pin
Michael Sync21-Aug-07 21:26
Michael Sync21-Aug-07 21:26 
QuestionHelp with CheckBoxList Pin
paulsgregg21-Aug-07 20:34
paulsgregg21-Aug-07 20:34 
AnswerRe: Help with CheckBoxList Pin
Michael Sync21-Aug-07 20:58
Michael Sync21-Aug-07 20:58 
QuestionUser Roles Pin
Illegal Operation21-Aug-07 20:30
Illegal Operation21-Aug-07 20:30 
QuestionLife cycle of ASP.Net page Pin
Milind Panchal21-Aug-07 20:27
Milind Panchal21-Aug-07 20:27 

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.