TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
evanwang
NA
4
0
Executing SQL scripts from C#
Nov 23 2004 9:16 AM
Is there any programmatic way to execute a sql script from C#? I'm using SQL Server and I do not want to use osql.exe. Here is an example: CREATE TABLE... GO CREATE TABLE... GO CREATE CONSTRAINT... GO INSERT DATA... GO I tried reading the file and setting the CommandText in the SqlCommand object, but since the GO needs to be in a separate line when executing, SQL Server gives an error. I tried some various newline characters, but none worked. Any thoughts? Thanks, Evan
Reply
Answers (
3
)
Help in inserting quotes in database
Add a table, fields and records