DataAdapter.Fill method problem

  • Thread starter Thread starter Vivek
  • Start date Start date
V

Vivek

When I run following code it creates two connections to
Sql Server database. I observed this from SQL Profiler.

Can someone explain this behavior?

SqlDataAdapter objAdpater = new SqlDataAdapter("SELECT *
FROM TABLE", "Server=xyz;User ID=sa;Password=");

DataSet objDS = new DataSet();

objAdpater.Fill(objDS);

I am running windows 2000 SP3, SQL Server 2000 SP3.

-Thanks
-Vivek.
 
1) NEVER leave the SA password blank.
2) Don't make a practice of using SA to develop applications as it only
masks and disables many of the security features your customer will mention
in court when they sue you. See 1.
3) How do you know you have two connections? It takes one connection to
"look".


--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top