question

Kenrick77-4970 avatar image
0 Votes"
Kenrick77-4970 asked ZhanglongWu-MSFT commented

I cannot save my data in datagridveiw to the access database

Hi all,
I cannot save my data in datagridveiw to the access database, can provide me the possible errors? Thanks

124306-capture3.png


dotnet-visual-basic
capture3.png (43.0 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I discovered the data was save to the Debug folder already. Can any expert explain? Thanks a lot in advance.

0 Votes 0 ·

You'll need to post the code you're using to save. A screenshot tells us nothing about the data framework you're using or how you're getting/setting the data. All this determines the behavior.

0 Votes 0 ·

@Kenrick77-4970,

Is there arny update about your issue, it would be better to solve the issue if you could share your code, error message, simple reprdoucable project.

Best regards,
Zhanglong

0 Votes 0 ·

1 Answer

cooldadtx avatar image
1 Vote"
cooldadtx answered

I assume you mean when you save your data it is being saved to the debug folder Access file. That is likely because in your connection string you are using a local path to the Access file. Since your app (in Debug mode in the debugger) is running from the Debug folder then any relative paths will be relative to that. Hence if your connection string to the DB is something like 'MyDatabase.mdb` then it'll be loaded and saved in the directory where the binary is.

If you want to save the file elsewhere then you'll need to specify the full path in your connection string.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.