ashok dahiya


{ City } sonipat
< Country > india
* Profession * software developer
User No # 4745
Total Questions Posted # 0
Total Answers Posted # 5

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 39
Users Marked my Answers as Wrong # 18
Questions / { ashok dahiya }
Questions Answers Category Views Company eMail




Answers / { ashok dahiya }

Question { 6468 }

What are the different namespaces used in the project to
connect the database?


Answer

system.data
system.data.oledb
system.data.sqlclient

Is This Answer Correct ?    0 Yes 0 No

Question { 5951 }

What is a datagrid?


Answer

datagrid is inbuilt control in .net that show tabular form
of data from data base.

Is This Answer Correct ?    6 Yes 1 No


Question { Keane India Ltd, 12543 }

Write steps of retrieving data using ado.net ?


Answer

We can retrieve data in following ways in .net
1st we have to create connection object through sqlclient or
oledb provider.then open connection
2nd We can choose datacommands or data adapter(by sqlclint
or oledb dataprovider
system.data
system.data.oledb //to oledb adapter
system.data.sqlclient //to sqlclient adapter
dim con as new connection
con=("provider=oledb;initial
catalog=databasename;userid=sa;paswd=;data source=servername;")
con.open
dim query as string="select* from tabel"
dim ad as new oledb.oledbprovider(query,con)
dim ds as dataset
ad.fill(ds)
dim dt as new datatable()
dt=ds.table(0) //is for ist tabel
dim dr() as datarow //it is array becouse it contain all
rows and coulmn for table
dr()=dt.select("") //blank for all coulmns and rows
for i as integer=0 to dr.length-1.tostring
if dr(i)("empid")=textbox.text then
listbox1.items.add(dr(i)("firstname")&
dr(i)("lastname")& dr(i)("email"))
//it will add records of perticular row that matches to the
textbox text in listbox.suppose u enter a001 if it is valide
id then the all records of a001 r added into the list box.//
next

it will work fine.try thanks

Is This Answer Correct ?    3 Yes 1 No

Question { MMTS, 12200 }

Sequence to connect and retrieve data from database useig
dataset ?


Answer

We r talking about vb.net not c# codding
system.data
system.data.sqlclient

dim con,s as string
con="Server=servername;database=name;uid=sa;pwd=;"
s="Select * from tablename"
dim ad as new sqldataadapter(s,con)
dim ds as dataset
ad.fill(ds)
dim dv as dataview= new dataview(ds.tables("tablename"))
dv.sort="Name desc"
listbox.datasource=ds
listbox.displayMember="Name"&"Age"&"sex"...

it will work fine thanx!

Is This Answer Correct ?    2 Yes 7 No

Question { Accenture, 27531 }

Difference between ADO and ADO.net ?


Answer

main upgaded differencees
1disconnected data archetecture
2 data cached in dataset
3 data transefer in XML format
4 interaction with database is done through the datacommands

Is This Answer Correct ?    28 Yes 9 No