.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

ทำไมมันไม่แสดงค่าล่ะ ดูให้หน่อย Options · View
max_swu
Posted: Saturday, August 09, 2008 4:43:01 PM
Rank: มือฝึกหัด
Groups: Member

Joined: 7/9/2008
Posts: 5
Location: bkk

 

Protected Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.ClickDim myconn As New SqlConnection _"Data Source=ACC226\SQLEXPRESS;Initial Catalog=mxscggroup_net_scggroup;User IdSpeak to the handPasswordSpeak to the hand Integrated Security=SSPI;")Dim myda As New SqlDataAdapter("Select * From member where username='" & txtUserName.Text & "' and password='" & txtPassWord.Text & "'", myconn)Dim ds As New DataSet"Table")If ds.Tables("Table").Rows.Count >= 1 Then

privilage.Text = ds.Tables(

lblphone.Text = ds.Tables(

 

"table").Rows(0).Item(3)"table").Rows(0).Item(4)'ตรวจสอบสิทธิ์ 1 = ลูกค้าให้ไปที่หน้า indexUser.aspx ถ้าเป็น 0 = admin ไปที่หน้า admin/default.aspx

 

If (privilage.Text = 1) Then

 

Session(

 

Me.Response.Redirect("indexUser.aspx")"phone") = lblphone.TextElseIf (privilage.Text = 0) Then

 

 

Me.Response.Redirect("admin/default.aspx")Else

lblerror.Text =

"ไม่มีข้อมูล"

 

End If

 

Else

lblerror.Text =

"Username หรือ Password ไม่ถูกต้องกรุณาพิมพ์ใหม่ค่ะ"

 

 

End If

 

End Sub

คือ ตรง privilage.Text  กับ lblphone.Text  อ่ะค่ะ ทำไมมันไม่แสดงค่าที่รับมาจากฐานข้อมูล แต่ตรงช่วง

มันไปตามหน้าที่เรากำหนดนะคะ   ดูให้หน่อยนะคะ ขอบคุณค่ะ

 

(

 

 

myda.Fill(ds,

 

nuttaponp
Posted: Wednesday, September 10, 2008 5:37:56 PM
Rank: มือพระกาฬ
Groups: Member

Joined: 9/9/2008
Posts: 62

อ่านแล้วงงๆนะครับ

ผมเข้าใจว่ามันไม่ทันแสดงค่าเพราะถูก redirect ไปหน้าอื่นเสียก่อน

fronzen
Posted: Thursday, September 11, 2008 9:29:54 AM
Rank: มือสมัครเล่น
Groups: Member

Joined: 4/22/2008
Posts: 18
ตัวแปร session นะครับ ตอนกำหนดชือตัวแปร มันมี redirect อยู่ ก็เลย redirect ไปก่อนที่จะเก็บค่า
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by