Click here to Skip to main content
15,886,689 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Storing tamil virtual keyboard to sql server 2005 database Pin
jkirkerx9-Dec-13 12:14
professionaljkirkerx9-Dec-13 12:14 
AnswerRe: Storing tamil virtual keyboard to sql server 2005 database Pin
Mycroft Holmes9-Dec-13 13:08
professionalMycroft Holmes9-Dec-13 13:08 
QuestionTrying to use ASP.NET Custom validator for conditional validation Pin
Member 104518047-Dec-13 13:06
Member 104518047-Dec-13 13:06 
AnswerRe: Trying to use ASP.NET Custom validator for conditional validation Pin
jkirkerx7-Dec-13 13:38
professionaljkirkerx7-Dec-13 13:38 
AnswerRe: Trying to use ASP.NET Custom validator for conditional validation Pin
joginder-banger12-Dec-13 6:26
professionaljoginder-banger12-Dec-13 6:26 
QuestionSql and asp.net Pin
Otekpo Emmanuel7-Dec-13 11:28
Otekpo Emmanuel7-Dec-13 11:28 
AnswerRe: Sql and asp.net Pin
Mycroft Holmes7-Dec-13 12:39
professionalMycroft Holmes7-Dec-13 12:39 
GeneralRe: Sql and asp.net Pin
Otekpo Emmanuel9-Dec-13 12:13
Otekpo Emmanuel9-Dec-13 12:13 
Thanks Mycroft, your reply was helpful. But it only retrieved one record, and I suggest that if I can bind the results found to a datalist, then everything will display. This is what I have tried so far:
Dim cn As new SqlDatasource
Sub Connect()
Try
If cn.State = Data.ConnectionState.Open Then cn.Close()
cn.ConnectionString =ConfigurationManager.ConnectionStrings("infoConnectionString").ConnectionString
cn.Open()
Catch ex As Exception
End Try
End Sub
Protected Sub btnlogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.Click
Connect()
Dim cmd As New SqlCommand
cmd.Connection = cn
cmd.CommandText = "select * from Bkstbl where Author like txtauthor.Text and Password=@Password
cmd.Parameters.AddWithValue("@author", txtauthor.Text)
cmd.Parameters.AddWithValue("@Password",txtpassword.Text)
Dim dr As SqlDataReader = cmd.ExecuteReader cmd.Parameters.Clear()
If dr.HasRows = True Then
'the aim of this code is to display only the textbooks written by the author
Datalist1.DataSource=dr("Txtbooks")
Datalist1.DataBind
dr.Close()
Else
dr.Close()
Msgbox("Invalid author name or password")
End If
End If
when I clicked on the search button, an error will show. This is the error that shown: InvalidOperationException unhandled user code.
For futher explanation, what I want is; taking for example John has 10 textbooks and James has 6 textbooks stored in database, when John wants to retrieve his textbooks from database, only his textbooks should display on the datalist excluding James textbooks(note: all textbooks saved by John, will have the same author name). Sorry if the request is too big, but please help me out, I am stuck...
GeneralRe: Sql and asp.net Pin
Mycroft Holmes9-Dec-13 13:01
professionalMycroft Holmes9-Dec-13 13:01 
GeneralRe: Sql and asp.net Pin
Otekpo Emmanuel10-Dec-13 11:01
Otekpo Emmanuel10-Dec-13 11:01 
GeneralSolved: Sql and asp.net Pin
Otekpo Emmanuel16-Dec-13 4:46
Otekpo Emmanuel16-Dec-13 4:46 
QuestionHow to catch up a HTML Control in code? Pin
Member 104545925-Dec-13 3:52
Member 104545925-Dec-13 3:52 
AnswerRe: How to catch up a HTML Control in code? Pin
thatraja5-Dec-13 4:20
professionalthatraja5-Dec-13 4:20 
GeneralRe: How to catch up a HTML Control in code? Pin
Member 104545925-Dec-13 4:32
Member 104545925-Dec-13 4:32 
GeneralRe: How to catch up a HTML Control in code? Pin
thatraja5-Dec-13 4:35
professionalthatraja5-Dec-13 4:35 
GeneralRe: How to catch up a HTML Control in code? Pin
Mycroft Holmes6-Dec-13 13:21
professionalMycroft Holmes6-Dec-13 13:21 
GeneralRe: How to catch up a HTML Control in code? Pin
Member 104545929-Dec-13 1:42
professionalMember 104545929-Dec-13 1:42 
GeneralRe: How to catch up a HTML Control in code? Pin
Member 104545929-Dec-13 1:43
professionalMember 104545929-Dec-13 1:43 
AnswerRe: How to catch up a HTML Control in code? Pin
ZurdoDev6-Dec-13 10:18
professionalZurdoDev6-Dec-13 10:18 
AnswerRe: How to catch up a HTML Control in code? Pin
Member 104513158-Dec-13 16:25
Member 104513158-Dec-13 16:25 
QuestionPHP vs asp.net Pin
Member 104426195-Dec-13 3:20
Member 104426195-Dec-13 3:20 
AnswerRe: PHP vs asp.net Pin
thatraja5-Dec-13 4:26
professionalthatraja5-Dec-13 4:26 
QuestionRe: PHP vs asp.net Pin
Deflinek5-Dec-13 4:27
Deflinek5-Dec-13 4:27 
AnswerRe: PHP vs asp.net Pin
ZurdoDev6-Dec-13 10:19
professionalZurdoDev6-Dec-13 10:19 
GeneralRe: PHP vs asp.net Pin
jkirkerx7-Dec-13 14:02
professionaljkirkerx7-Dec-13 14:02 

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.