row and column access in database
-
I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.
I cant find any meaning.. you can loop through the DataTable fetched from the database.. or you can loop using DataReader.. What else do you need.? ? :confused::confused:
Abhishek Sur My Latest Articles Working with Excel using MDAC
Basics on LINQ and Lambda Expressions
Create .NET Templates -
I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.
You want searching data on DB by TSQL?
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.
-
I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.
-
Do you like to compare Your Column of values with the database's column of values ?
Education is not a way to escape poverty — it is a way of fighting it.
Let my explain what I want with an example: I want copmare TextBox's value with column ID in Database then if they were equal, modify Qyt column.
int intPosition_ID; objDataView.Sort = "ID"; intPosition_ID = objDataView.Find(TextBox.Text); if (intPosition_ID != -1 ) { // modify Qyt column that is ID=TextBox. }
-
Let my explain what I want with an example: I want copmare TextBox's value with column ID in Database then if they were equal, modify Qyt column.
int intPosition_ID; objDataView.Sort = "ID"; intPosition_ID = objDataView.Find(TextBox.Text); if (intPosition_ID != -1 ) { // modify Qyt column that is ID=TextBox. }
-
You can try this, if you use SQL server 2005 select name from sys.columns where object_id = (select object_id from sys.tables where name = 'tablename')
Education is not a way to escape poverty — it is a way of fighting it.
-
Yeah, Im using SQL server 2005. Im beginner in ASP.NET and plz explain it more clearly. I didnt understand your code and I dont know what am I suppose to do ! :confused:
if I understood your requirement correctly, you want to compare the textbox value with a table's all columns. For that you can use that query. Sys.Columns is system table which contains all the table's columns. By referring the object_id you can fetch the required column. select name from sys.columns where object_id = (select object_id from sys.tables where name = 'customer') and name = 'LastName' If you have AdventureWorksLT database you can try this. Let us know whether it solves your problem.
Education is not a way to escape poverty — it is a way of fighting it.