Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8950167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:23:29+00:00 2026-06-15T13:23:29+00:00

I have a little problem about that. When i create a script with VS2012

  • 0

I have a little problem about that. When i create a script with VS2012 ,it looks like that
(DataBase Name : LSProjeDB and have a table as Musteri) (created like that : go table > update>genarete script >wow)

GO SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "C:\USERS\YC\DOCUMENTS\LSPROJEDB.MDF"
:setvar DefaultFilePrefix "C_\USERS\YC\DOCUMENTS\LSPROJEDB.MDF_"
:setvar DefaultDataPath "C:\Users\YC\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0\"
:setvar DefaultLogPath "C:\Users\YC\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0\"
GO
:on error exit
GO

/*
Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
To re-enable the script after enabling SQLCMD mode, execute the following:
SET NOEXEC OFF; 
*/


:setvar __IsSqlCmdEnabled "True"
GO
IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
    BEGIN
        PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
        SET NOEXEC ON;
    END
GO
USE [$(DatabaseName)];
GO
PRINT N'Update complete.'
GO

but it is looks like wrong!!
and i used that c# code :

 string str = "DataSource=(local);Initial Catalog=DatabaseName ;Integrated Security=True";
        FileInfo file = new FileInfo("D:\\SQLQuery2.sql");
        string script = file.OpenText().ReadToEnd();
        SqlConnection conn = new SqlConnection(str);
        Server server = new Server(new ServerConnection(conn));
        server.ConnectionContext.ExecuteNonQuery(script);

and i got :

ArgumentException is unhandled!
Keyword not supported: ‘datasource’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:23:30+00:00Added an answer on June 15, 2026 at 1:23 pm

    DataSource <– you have a space missing between Data and Source

    "Data Source=(local);Initial Catalog=DatabaseName;Integrated Security=True;";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a curious little problem. I have a service that needs to create
I have a little problem about the sort direction of a specific column in
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have a little problem about using jQuery (I really do not know jQuery
I am little bit confused about following problem & their solutions: i have 2
I have a little Problem with the app that I'm developing. In the App
Back story i have a table that stores cached times, and currently has about
I have a little problem that i think it's easy so get a solution,
I would love to have a little problem solved. I know that it's not
I have little problem with a replacement of a little part in an url.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.