Sql Error

aru

Member
hi

This is My Code

Reader.New1
Command.AddParameter("SEARCH")
Command.SetParameter("SEARCH","%" & TextBox1.Text & "%")


str = "SELECT * FROM info WHERE name LIKE @SEARCH"


Command.CommandText = str
Connection.BeginTransaction
Reader.Value = Command.ExecuteReader

Do While Reader.ReadNextRow = True
Table1.AddRow (Reader.GetValue(0))

Loop
Reader.Close
when iam click the Search Button The Table is Show Button. Then I again Clicked The Search Button

There is a Error Like This
Please See The Attachment
 

Attachments

  • untitled.GIF
    untitled.GIF
    9.2 KB · Views: 215

mjcoon

Well-Known Member
Licensed User
So according to the error text the error is happening on the AddRow() and is not an SQL error.

Are you certain that no two SQL rows have the same ("arun") value?

How about removing the uniqueness requirement of the "Name" field in the table and seeing what table rows get created then?

Mike.
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello,

I had more or less the same problem and found a solution in the German forum:

Add a Sub with the code to add columns and call this Sub in the App_start.

Hope this helps.

Regards,
Helen.
 
Top