dotnet framework


  • 1. Diffrent execution plan = Bad performance.
    Hi, When running a query in Query analyzer (SQL Server 2000) I dont get the same execution plan as If I run the query to a DataReader object in .NET framework. Anyone know why execution plan differ between those two? I get very poor performance in .NET due to this. Regards Fredrik Melin
  • 2. More forms in WinForms and DataSet
    Hello I have one question Iam newbie in .Net i use C# i look some samples but i can't find any samples where there be more forms, and using the sam dataset. Can somebody write me some link or tell what i s the best way using dataset-s if i have more forms ad i want to use one dataset in more forms,... thanks Matej


Postby TompIfe » Tue, 02 Sep 2008 22:37:12 GMT

I have an Access database with a querry containing about 40,000 rows.

OleDbCommand test = conn.CreateCommand();

"SELECT COUNT(*) FROM expws3";


int antall = (int)test.ExecuteScalar();

only 20,000 rows are returned. However, whem I copy the contents of the 
querry to a Table, a get the full 40,000 number of rows.
Any suggestions?
Best regards,


Postby Miha Markic » Wed, 03 Sep 2008 15:10:46 GMT

Did you try the same select from within Access?

Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog:  http://www.**--****.com/ 


Postby v-jzho » Wed, 03 Sep 2008 16:08:47 GMT

ello TompIfe,

Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you. After reading your
post carefully, I do the following test and research on my side:

I have created a simple access database which has a table and a query of
the table in it. There are 40,000 rows in the query. I use the exactly same
codes you post to get the row count of query. But it returns the correct
count number.

This issue is not a general one and I do not find a similar report before.
To work the issue out, it needs both our sides' efforts. So it is necessary
for us to collect some information to troubleshoot.

Here are some points we need to clarify at the moment:

1.What is the version of Access and have you applied the newest services
pack of Office products. I test on Access 2003 SP3 and Access 2007 SP1, and
the row count always returns correctly.

2.How is the query expws3 created? Is it generated from several tables and
some complicated relationships? If the expws3's creating is not supposed to
be discussed in public, please feel free to send me emails about this
information to XXXX@XXXXX.COM . After getting the info of expws3, I
will try again to reproduce the symptom according to the definition of the

3.After the expw3 is created, have we modified any based table's structure?
I ask this question because a similar issue in SQL Server was reported.
That issue resulted from the DataView's Schema was not updated after its
based table's schema was modified.

4.If you can provide the reproducible Access database and sent it to me,
that will be helpful for us to have a clearer picture of the issue.

I know there are many questions asked in a time, but they are needed to
narrow down the problem. Thanks for your understanding on this.

Also, here are some suggestions you can try on your side:

1.Make sure the Access file is saved before we use the code to retrieve
data from Access database. The retrieved data will not be updated one
unless we save the Access database file.

2.Execute the sql command "Select * from expws3" with test.ExecuteReader()
and use a loop to find how many rows exist in the returned reader. Codes
look like:
OleDbCommand test = con.CreateCommand();
test.CommandText = "Select * from expws3";

int count = 0;
OleDbDataReader reader = test.ExecuteReader();
while (reader.Read())


3. Duplicate the current db's schema to a new access db. Input a small
number of rows into it for test, and see whether the query works correctly
when the row count is small.

Best regards,
Ji Zhou ( XXXX@XXXXX.COM , remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:

Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Mic


Postby v-jzho » Fri, 05 Sep 2008 17:27:48 GMT

Hello Tom,

I am writing to check the status of the issue on your side. Could you 
please let me know if the suggestion works for you or not? If you have any 
questions or concerns, please feel free to let me know. I am more than 
happy to be of assistance. 

Have a nice day!

Best regards, 
Ji Zhou  ( XXXX@XXXXX.COM , remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 

This posting is provided "AS IS" with no warranties, and confers no rights.


Postby TompIfe » Fri, 05 Sep 2008 20:25:29 GMT

ello Ji,

1. I use Access 2000. However, I have saved the database also in Access 2007
and tried it. This produces no change.
2. I have sent you the querry SQL as a mail to: XXXX@XXXXX.COM .
3. Tables structures have not been changed.
4. The database is commercial and confidential so unfortunately I cannot
send it to you although I
understand that taht would be advantageous.

I have made a loop that read the number of rows in the returned read. This
is the same 24005. Access shows that the number of rows in the querry is
I have also copied the SQL statement in the Access querry and used that as
the CommandText to the reader. This produces no change.

Best regards,

""Ji Zhou [MSFT]"" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...


Postby TompIfe » Fri, 05 Sep 2008 20:27:48 GMT

Yes. It produces the same count as the Reader in ADO (24005 in stead of 

Similar Threads:


2.Missing first record

Using asp.net and .net framework 2 and SQL server 2000
I am using simple SELECT statement in SP to retrieve data and then bind to a 
datagrid but fail to pick up the first record in the dataset:

        invConn = New 
        invComm = New SqlCommand(zStrg, invConn)
        invComm.CommandType = Data.CommandType.StoredProcedure
        invComm.Parameters.AddWithValue("@ClCode", strClCode)
        iP = invComm.ExecuteReader
        dgPInv.DataSource = iP

The SP is pulling back the full dataset but code above misses first rec.
with thanks

3.Add missing records into datatable..


I'd approach this via brute force. Load the two tables, search the child
table for the missing records and create them, then set the relation.

This is not a good idea to do client side if the two tables are large. In
that case, load a table into SQL with the dates, add the child records, then
extract what you need. These tables can be psuedo temp tables if needed.

"Mahesha" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Hello,
> I want to add a data relation between two tables based on a date.
> I have a datearray table in a SQL server database
> which contains a Date column.
> I query sql server to get distinct dates from this table based on a
> daterange(say 5 years)  and populate a datatable.
> I then query a sybase data source which contains Date and datavalue
> fields to get the data for the same 5 years date range.
> Now I have two datatables in a data set one with Date data(master
> table) and another with date,datavalue data (detail table).
> I want to add datarelation between these two tables on the date
> field.This is going to fail because there are some date records in my
> master table which do not have child records in the detail table.
> I want to add these missing date records into my child datatable with
> null datavalues and then add the datarelation. I want to know which is
> the easiest way to accomplish this.?
> Thanks
> -Mahesha

4.text missing from sql record after return

I have a web form with a multiline textbox. The string value entered into
the textbox is inserted into a field in the sql server. If a return is
pressed in the web form textbox to start a new line, the text following the
return appears in the sql insert statement when printed before inserting,
but is missing from the sql stored text value. I
check the sql stored value by running a select statement after the insert.
If no return is pressed in the web form textbox then the entire value is
inserted into the sql cell. Any ideas? I am running MSDE 2000 and VB.NET.

Thanks for your help,

5.Reading an Excel file - missing first record....


I am using the following code to read the data from an Excel spreadsheet. It 
runs basically OK but it skips the first row of the spreadsheet. Does anyone 
know how to either read the first line or (*hack warning*) insert a blank 
record in the first line of the worksheet....?

Dim cnExcel As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data 
Source = MyFile.xls;Extended Properties=Excel 8.0;")
lookup = cnExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim cmdExcel As New OleDbCommand("SELECT * FROM [" & 
lookup.Rows(0)("TABLE_NAME") & "]", cnExcel)
Dim dr As OleDbDataReader
dr = cmdExcel.ExecuteReader
If dr.Read Then
end if

Thanks in advance,


6. Missing Record in Crystal Report

7. Newbie Missing Something with Access DB Update Using VB .NET

8. MS Access provider missing

Return to dotnet framework


Who is online

Users browsing this forum: No registered users and 63 guest