Click here to Skip to main content
16,007,163 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionfor quiz program Pin
bapu288915-Nov-06 9:04
bapu288915-Nov-06 9:04 
AnswerRe: for quiz program Pin
Christian Graus15-Nov-06 9:20
protectorChristian Graus15-Nov-06 9:20 
QuestionRe: for quiz program Pin
bapu288916-Nov-06 9:11
bapu288916-Nov-06 9:11 
AnswerRe: for quiz program Pin
Christian Graus16-Nov-06 9:18
protectorChristian Graus16-Nov-06 9:18 
QuestionRe: for quiz program Pin
bapu288916-Nov-06 9:26
bapu288916-Nov-06 9:26 
AnswerRe: for quiz program Pin
Christian Graus16-Nov-06 9:39
protectorChristian Graus16-Nov-06 9:39 
AnswerRe: for quiz program Pin
bapu288916-Nov-06 9:51
bapu288916-Nov-06 9:51 
QuestionDatagrid - Populate with SQL Select Statement Pin
Larry White15-Nov-06 7:53
Larry White15-Nov-06 7:53 
I am trying to populate a datagrid using a SQL select statement. The statement contains a "WHERE fieldname LIKE textbox.text" as below in my code. The problem is, I can't get the code right to display the data in the grid when the button is clicked. Here is my code so far:


Public Sub loadDoc()
Dim DAdapt As SqlDataAdapter
Dim custMap As DataTableMapping = DAdapt.TableMappings.Add("Table", "DocumentList")
custMap.ColumnMappings.Add("Title", "Title")
custMap.ColumnMappings.Add("Expiration", "Expiration")
custMap.ColumnMappings.Add("Keywords", "Keywords")
Dim sql2 As String = "Select * FROM DocumentList WHERE Keywords LIKE '" & tbSearch.Text & "'"
Dim ds As New DataSet
DAdapt = New SqlDataAdapter(sql2, cnn1)
Me.cnn1.Open()
DAdapt.Fill(ds)

Try
grdDocumentList.DataSource = ds.DefaultViewManager
ds.Clear()
ds.Merge(ds)
grdDocumentList.SetDataBinding(ds, "DocumentList")
Catch eLoadMerge As System.Exception
Throw eLoadMerge
End Try
Me.cnn1.Close()
End Sub


Thank you, Big Grin | :-D


LWhite

AnswerRe: Datagrid - Populate with SQL Select Statement Pin
Kevin Nicol15-Nov-06 8:53
Kevin Nicol15-Nov-06 8:53 
GeneralRe: Datagrid - Populate with SQL Select Statement Pin
Larry White15-Nov-06 10:12
Larry White15-Nov-06 10:12 
GeneralRe: Datagrid - Populate with SQL Select Statement Pin
Larry White15-Nov-06 10:36
Larry White15-Nov-06 10:36 
Questioncopy a file from a web folder Pin
CS_0115-Nov-06 7:46
CS_0115-Nov-06 7:46 
QuestionWeb service problem with VS.net 2005 and proxy server Pin
tjsharkfan15-Nov-06 7:40
tjsharkfan15-Nov-06 7:40 
Questionvisual studio .NET / required files Pin
7prince15-Nov-06 6:33
7prince15-Nov-06 6:33 
AnswerRe: visual studio .NET / required files [modified] Pin
Kevin Nicol15-Nov-06 7:23
Kevin Nicol15-Nov-06 7:23 
QuestionZip UnZip And DLL's Pin
TheChaosLord.UK15-Nov-06 6:27
TheChaosLord.UK15-Nov-06 6:27 
AnswerRe: Zip UnZip And DLL's Pin
nlarson1115-Nov-06 6:38
nlarson1115-Nov-06 6:38 
QuestionGetFiles() method altering LastAccessedDate???? Pin
GaryT8015-Nov-06 6:25
GaryT8015-Nov-06 6:25 
AnswerRe: GetFiles() method altering LastAccessedDate???? Pin
Guffa15-Nov-06 6:33
Guffa15-Nov-06 6:33 
GeneralRe: GetFiles() method altering LastAccessedDate???? Pin
GaryT8015-Nov-06 6:42
GaryT8015-Nov-06 6:42 
GeneralRe: GetFiles() method altering LastAccessedDate???? Pin
GaryT8015-Nov-06 6:59
GaryT8015-Nov-06 6:59 
GeneralRe: GetFiles() method altering LastAccessedDate???? Pin
Guffa15-Nov-06 8:40
Guffa15-Nov-06 8:40 
GeneralRe: GetFiles() method altering LastAccessedDate???? Pin
GaryT8015-Nov-06 8:47
GaryT8015-Nov-06 8:47 
AnswerRe: GetFiles() method altering LastAccessedDate???? Pin
Dave Kreskowiak15-Nov-06 7:27
mveDave Kreskowiak15-Nov-06 7:27 
Questionplaying card class Pin
willcocksyido15-Nov-06 5:59
willcocksyido15-Nov-06 5:59 

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.