Avatar of bgraves
bgraves
Flag for United States of America asked on

.Net adds Tic marks to SQL Column Names

Windows 10, VB .Net, VS 2019:

I have a Visual Studio dataset with a number of tables.

The database is Microsoft SQL accessed with the msoledbsql_64.msi driver.

I click "configure" on the data table adapters and input SQL query.

So far so good, I can fill the tables. BUT when I check on the "UpdateCommand.CommandText, InsertCommand.CommandText and the DeleteCommand.CommandText which are automatically generated, each column name is enclosed in ` (tic) like ` Name1`...`Name2`  and so on. I could understand  [...] but not these crazy tic marks which are rejected by the SQL Server.


I have written code to edit all the queries and remove the tics. But where did they come from, what caused this strange query?

.NET ProgrammingMicrosoft SQL ServerVisual Basic.NET* visual studio 2019

Avatar of undefined
Last Comment
bgraves

8/22/2022 - Mon
bgraves

ASKER
p.s.
I understand that 'name' is ok for SQL Server, ' is an ok character, but the character being used is 
` the back tic and that is soundly rejected every time.

Open in new window

Kelvin McDaniel

This sounds like a bug in the generator tool to me. Easily worked around, sure -- just do a global search and replace for the tic mark. However, you impact would be greater by providing feedback to Microsoft and recommending that they fix their tool within Visual Studio.
ASKER CERTIFIED SOLUTION
bgraves

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy