Click here to Skip to main content
16,011,757 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Getting the error : The viewstate is invalid for this page and might be corrupted Pin
Harini N K6-Mar-07 21:06
Harini N K6-Mar-07 21:06 
GeneralRe: Getting the error : The viewstate is invalid for this page and might be corrupted Pin
anufabian6-Mar-07 21:34
anufabian6-Mar-07 21:34 
QuestionUser Based Menus.... Pin
Member 38798816-Mar-07 17:04
Member 38798816-Mar-07 17:04 
AnswerRe: User Based Menus.... Pin
Vsree6-Mar-07 18:26
Vsree6-Mar-07 18:26 
GeneralRe: User Based Menus.... Pin
Member 38798816-Mar-07 20:12
Member 38798816-Mar-07 20:12 
GeneralRe: User Based Menus.... Pin
Member 38798817-Mar-07 22:07
Member 38798817-Mar-07 22:07 
QuestionGridView .net 2.0 Vs20005 Pin
AnhTin6-Mar-07 16:23
AnhTin6-Mar-07 16:23 
QuestionCan you help me where i should put the code... Pin
blitz2bleach6-Mar-07 14:25
blitz2bleach6-Mar-07 14:25 
Hello there, i just need your opinion about this...i have now database and all i need to do is to connect it on this page..my question is..where i should put the code of connecting this page to my database that has a column of "ID" and "Password" and it has already a data of "ID:054806054" and PAssword:"blitz2bleach"...can i access it on my database..should i used a "connection string" on it?what is the easy to used "data Source"?sqlDataSource or AccessDataSource?...i dont want to include some ado.net on it...it is possible to code it only in asp.net?..

this are the codes hope you can help me and should i get your opinion what code i should remove and add..and in where i should put it...

sorry but i know that all you can do is to make a comment but this is urgent..it is our project to bulid a website and im new in progamming in asp.net, i read books and have aself study on it..but the things is actual teaching is the best, but here no one in my professor can teach me..

hope you can help to figure out what should i add and remove code..

for now thank you for you cooperation and for the help you will given me n advance...Big Grin | :-D ;)Smile | :)

----.this code is from the file name "index.aspx"




<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" errormessage="*"
="" display="Dynamic" controltovalidate="txtUname">Username




<asp:requiredfieldvalidator display="Dynamic" id="RequiredFieldValidator2" controltovalidate="txtPass" runat="server" errormessage="*">Password



 

<asp:button id="Button1" runat="server" text="Sign In" postbackurl="index.aspx"> 




<-------End of code "index.aspx"

-------------->this code is my index.aspx.vb

Option Explicit On

Imports System.Data.OleDb
Imports System.Configuration.ConfigurationSettings
Imports System.Web.Security



Namespace Informatics



Partial Class index
Inherits System.Web.UI.Page

Dim strString As String
Dim oOleDbConnection As OleDbConnection
Dim sConnString As String
Dim oOleDbCommand As OleDbCommand
Dim oOleDbdr As OleDbDataReader
Dim tempUser As String
Dim tempPass As String
Dim ctr As Integer



#Region " Web Form Designer Generated Code "


'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.odaGbook = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
Me.PdsGbook2 = New Informatics.pdsGbook
Me.OleDbCommand1 = New System.Data.OleDb.OleDbCommand
CType(Me.PdsGbook2, System.ComponentModel.ISupportInitialize).BeginInit()
'
'odaGbook
'
Me.odaGbook.DeleteCommand = Me.OleDbDeleteCommand1
Me.odaGbook.InsertCommand = Me.OleDbInsertCommand1
Me.odaGbook.SelectCommand = Me.OleDbSelectCommand1
Me.odaGbook.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "gbook", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("address", "address"), New System.Data.Common.DataColumnMapping("age", "age"), New System.Data.Common.DataColumnMapping("gender", "gender"), New System.Data.Common.DataColumnMapping("ID", "ID")})})
Me.odaGbook.UpdateCommand = Me.OleDbUpdateCommand1
'
'OleDbDeleteCommand1
'
Me.OleDbDeleteCommand1.CommandText = "DELETE FROM gbook WHERE (ID = ?) AND (address = ? OR ? IS NULL AND address IS NUL" & _
"L) AND (age = ? OR ? IS NULL AND age IS NULL) AND (gender = ? OR ? IS NULL AND g" & _
"ender IS NULL)"
Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop" & _
"\db1.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:S" & _
"ystem database=;Jet OLEDB:SFP=False;persist security info=False;Extended Propert" & _
"ies=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create Syst" & _
"em Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact" & _
" Without Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1" & _
""
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO gbook(address, age, gender) VALUES (?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("age", System.Data.OleDb.OleDbType.Integer, 0, "age"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("gender", System.Data.OleDb.OleDbType.VarWChar, 50, "gender"))
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT address, age, gender, ID FROM gbook"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE gbook SET address = ?, age = ?, gender = ? WHERE (ID = ?) AND (address = ?" & _
" OR ? IS NULL AND address IS NULL) AND (age = ? OR ? IS NULL AND age IS NULL) AN" & _
"D (gender = ? OR ? IS NULL AND gender IS NULL)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("age", System.Data.OleDb.OleDbType.Integer, 0, "age"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("gender", System.Data.OleDb.OleDbType.VarWChar, 50, "gender"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
'
'PdsGbook2
'
Me.PdsGbook2.DataSetName = "pdsGbook"
Me.PdsGbook2.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.PdsGbook2, System.ComponentModel.ISupportInitialize).EndInit()

End Sub
Protected WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Protected WithEvents PdsGbook1 As Informatics.pdsGbook
Protected WithEvents PdsGbook2 As Informatics.pdsGbook
Protected WithEvents OleDbCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents odaGbook As System.Data.OleDb.OleDbDataAdapter


Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

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

End Sub

Public Overrides Sub Dispose()

End Sub


End Class

End Namespace
<--------------end of index.aspx.vb

----------------->this code is my web.config file



<configuration>
<appsettings>
<connectionstrings>
<system.web>

<compilation debug="true" strict="false" explicit="true">
<pages>
<namespaces>
<clear>
<add namespace="System">
<add namespace="System.Collections">
<add namespace="System.Collections.Specialized">
<add namespace="System.Configuration">
<add namespace="System.Text">
<add namespace="System.Text.RegularExpressions">
<add namespace="System.Web">
<add namespace="System.Web.Caching">
<add namespace="System.Web.SessionState">
<add namespace="System.Web.Security">
<add namespace="System.Web.Profile">
<add namespace="System.Web.UI">
<add namespace="System.Web.UI.WebControls">
<add namespace="System.Web.UI.WebControls.WebParts">
<add namespace="System.Web.UI.HtmlControls">



<authentication mode="Windows">



<------------end of web.config file
GeneralRe: Can you help me where i should put the code... Pin
Guffa6-Mar-07 14:46
Guffa6-Mar-07 14:46 
AnswerRe: Can you help me where i should put the code... Pin
Jasmine25016-Mar-07 15:13
Jasmine25016-Mar-07 15:13 
GeneralRe: Can you help me where i should put the code... Pin
blitz2bleach6-Mar-07 15:31
blitz2bleach6-Mar-07 15:31 
QuestionPage name from webcontrol Pin
digsy_6-Mar-07 13:34
digsy_6-Mar-07 13:34 
AnswerRe: Page name from webcontrol Pin
kubben6-Mar-07 14:08
kubben6-Mar-07 14:08 
AnswerRe: Page name from webcontrol Pin
Jasmine25016-Mar-07 15:21
Jasmine25016-Mar-07 15:21 
Questionshopping project Pin
reddyamar_uk6-Mar-07 13:06
reddyamar_uk6-Mar-07 13:06 
AnswerRe: shopping project Pin
Jasmine25016-Mar-07 15:09
Jasmine25016-Mar-07 15:09 
GeneralRe: shopping project Pin
siddisagar6-Mar-07 23:58
siddisagar6-Mar-07 23:58 
GeneralRe: shopping project Pin
reddyamar_uk10-Mar-07 11:50
reddyamar_uk10-Mar-07 11:50 
AnswerRe: shopping project Pin
reddyamar_uk10-Mar-07 12:42
reddyamar_uk10-Mar-07 12:42 
QuestionCheckbox always false [modified] Pin
Jasmine25016-Mar-07 11:26
Jasmine25016-Mar-07 11:26 
AnswerRe: Checkbox always false Pin
PandemoniumPasha6-Mar-07 17:55
PandemoniumPasha6-Mar-07 17:55 
GeneralRe: Checkbox always false Pin
Jasmine25017-Mar-07 5:53
Jasmine25017-Mar-07 5:53 
QuestionPrice of making WEB PORTAL Pin
Dragoslav Zaric6-Mar-07 8:36
Dragoslav Zaric6-Mar-07 8:36 
AnswerRe: Price of making WEB PORTAL Pin
Vasudevan Deepak Kumar6-Mar-07 9:16
Vasudevan Deepak Kumar6-Mar-07 9:16 
AnswerRe: Price of making WEB PORTAL Pin
Jasmine25016-Mar-07 10:39
Jasmine25016-Mar-07 10:39 

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.