Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fixed GithubIssue #29391#29614

Merged
AfsanehR-zz merged 4 commits intodotnet:masterfrom
AfsanehR-zz:github29391
May 11, 2018
Merged

Fixed GithubIssue #29391#29614
AfsanehR-zz merged 4 commits intodotnet:masterfrom
AfsanehR-zz:github29391

Conversation

@AfsanehR-zz
Copy link
Contributor

@AfsanehR-zz AfsanehR-zz commented May 9, 2018

Fixed issue #29391 Exception thrown with updateBatchSize bigger than 1 using SqlDataAdapter.

Edit:
Fixes #29391

@dnfclas
Copy link

dnfclas commented May 9, 2018

CLA assistant check
All CLA requirements met.

@saurabh500
Copy link
Contributor

Is there more code in the methods that you modified, that hasn't been ported over?

This change looks good.


using (var connection = new SqlConnection(tcpConnStr))
{
var cmd = new SqlCommand(createTableQuery, connection);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using(var cmd = new SqlCommand(createTableQuery, connection) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

using (var connection = new SqlConnection(tcpConnStr))
{
var dropTableQuery = "DROP TABLE IF EXISTS " + tableName;
var cmd = new SqlCommand(dropTableQuery, connection);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap command in using so that it is disposed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

public static void ExecuteNonQueries()
{
entities = new List<EventInfo>
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Formatting of { seems off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@saurabh500 saurabh500 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some test code needs to be addressed.

@AfsanehR-zz
Copy link
Contributor Author

AfsanehR-zz commented May 9, 2018

@saurabh500 there are some calls and checks missing but I don't see them being used or implemented anywhere- for instance regarding inRetry checks or TdsParser.ReliabilitySection.

@saurabh500
Copy link
Contributor

LGTM

private static string tableName = "BatchDemoTable";
private static List<EventInfo> entities;

[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be [CheckConnStrSetupFact] ? The test relies on a server being configured and CI doesn't have the SQL Server configured.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error in the CI is System.InvalidOperationException : The ConnectionString property has not been initialized.
This is happening because the Connection String being picked up with environment variables is empty in the CI. The [CheckConnStrSetupFact] should resolve the issue.
The build with this commit is expected to fail as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Updated the test.

@saurabh500
Copy link
Contributor

@dotnet-bot Test OSX x64 Debug Build please

12:00:49 requests.exceptions.HTTPError : 500 Server error : Internal Server Error [/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/tests.builds]

No test or compilation errors.

@AfsanehR-zz AfsanehR-zz merged commit 8e1d7bd into dotnet:master May 11, 2018
@karelz karelz added this to the 2.2.0 milestone May 12, 2018
steveisok pushed a commit to steveisok/corefx that referenced this pull request Oct 30, 2019
steveisok added a commit to mono/corefx that referenced this pull request Oct 30, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Fixed GithubIssue dotnet/corefx#29391

Commit migrated from dotnet/corefx@8e1d7bd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants