•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 392,075 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,068 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5136 | Replies: 5 | Solved
![]() |
•
•
•
•
i am developing a job site and i require to search for records from the database. i m passing value fro that parameter in textbox.
so please help me
thanks in advance
pseudo_code:
Dim strSQL as String strSQL = "SELECT Field1, Field2 FROM tbltemp WHERE Field1 = '" & TextBox1.Text & "'"
Hope this helps.
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
•
•
Join Date: Sep 2006
Posts: 17
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
pseudo_code:
Dim strSQL as String strSQL = "SELECT Field1, Field2 FROM tbltemp WHERE Field1 = '" & TextBox1.Text & "'"
Hope this helps.
thanks sir
this help me out. but when i m printing the record it also shows me textbox and command button. So sir now how do i remove this from print out.
•
•
Join Date: Oct 2006
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
•
•
i am developing a job site and i require to search for records from the database. i m passing value fro that parameter in textbox.
so please help me
thanks in advance
TRY THIS WITH ASP.NET USING VB.NET:
Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
Try
txtmsg.Text = ""
OleDbDataAdapter1 = New OleDbDataAdapter("select * from phbook where name like '" & ddl.SelectedItem.Text & "%'", OleDbConnection1)
OleDbDataAdapter1.Fill(DataSet21, "phbook")
OleDbConnection1.Open()
Dim com As New OleDbCommand
com.Connection = OleDbConnection1
com.CommandText = "select * from phbook"
dg1.DataBind()
Catch ex As Exception
txtmsg.Text = ex.ToString
OleDbConnection1.Close()
End Try
End Sub
THIS WILL SEARCH THE TEXT AND ONLY CHECKING THE FIRST LETTER OF THE GIVEN TEXT:
LIKE IF U WRITE "J" YHEN UT WILL SEARCH EVERY TEXT STARTING WITH THE LETTER J......
I HOPE THIS WILL HELP:cheesy:
When passing query use parameters:
To hide some element while print:
http://www.daniweb.com/techtalkforums/thread54946.html
•
•
•
•
cmd.CommandText = "SELECT ID, Title, Job FROM Jobs WHERE Title=@Title"
cmd.Parameters.Add("@Title", SqlDataType.NVarChar).Value = Me.txtTitle.Text.Trim
To hide some element while print:
http://www.daniweb.com/techtalkforums/thread54946.html
Last edited by ManicCW : Oct 3rd, 2006 at 2:07 am.
•
•
Join Date: Apr 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
TRY THIS WITH ASP.NET USING VB.NET:
Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
Try
txtmsg.Text = ""
OleDbDataAdapter1 = New OleDbDataAdapter("select * from phbook where name like '" & ddl.SelectedItem.Text & "%'", OleDbConnection1)
OleDbDataAdapter1.Fill(DataSet21, "phbook")
OleDbConnection1.Open()
Dim com As New OleDbCommand
com.Connection = OleDbConnection1
com.CommandText = "select * from phbook"
dg1.DataBind()
Catch ex As Exception
txtmsg.Text = ex.ToString
OleDbConnection1.Close()
End Try
End Sub
THIS WILL SEARCH THE TEXT AND ONLY CHECKING THE FIRST LETTER OF THE GIVEN TEXT:
LIKE IF U WRITE "J" YHEN UT WILL SEARCH EVERY TEXT STARTING WITH THE LETTER J......
I HOPE THIS WILL HELP:cheesy:
i try using this sample code to my application.but if you dont mind, can you state the namesapece of DATA declarations for connection n data type to match with this code.
tq
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
access advertising ajax asp breach business centro code coding combo daniweb data data protection database developer development dom dropdownlist engine feed google hacker internet linux malware marketing mcafee microsoft module msdn net news office reader reuse revenue search security server software spyware sql survey weather web wiki windows xml xoap yahoo
- Help needed: Connecting to sql server database (VB.NET)
- Connecting to a SQL Server Database using VB (VB.NET)
- connecting to sql server database using C++ program (C++)
- Sql Server Database Connector (JSP)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- sql server connection (ASP)
Other Threads in the ASP.NET Forum
- Previous Thread: Working with SQL server's Image data type
- Next Thread: Need Help


Linear Mode