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 6842193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:04:10+00:00 2026-05-27T00:04:10+00:00

Do I need to do anything in order to prevent inserts/updates/deletes/injection attacks when I’m

  • 0

Do I need to do anything in order to prevent inserts/updates/deletes/injection attacks when I’m using the following code?

public static DataSet getReportDataSet(string sqlSelectStatement)
{
    SqlDataAdapter da = new SqlDataAdapter(sqlSelectStatement, new SqlConnection(GlobalVars.ConnectionString));
    DataSet reportData = new DataSet();
    da.Fill(reportData, "reportData");
    return reportData;
}

The idea behind this is that I’ll be extracting the sql from a series of Crystal Reports, pulling the data for each report from the MS SQL Server, binding the data to the reports and then exporting the filled reports to PDF.

I know that you can use the built in functionality to get the reports to pull their own data, but my tests have shown that pushing the data to the reports is a whole bunch faster. My only issue with this is that I have no control over the reports that will be ran.

People will be required to provide their own login credentials for the SQL Server, so they will only be able to see data from the databases that they have permissions to… but some of the users have write permissions, and I’m worried that blindly running an sql string pulled from a Crystal Report could potentially allow for an insert/update/delete/injection attack…

I think that I might be worrying for nothing, but I can’t find anything that outright states if this could be used for things aside from selects.

Edit:

So from the initial comments, I think that I do have to worry about SQL statements aside from SELECTs. So my question now becomes; is there some whay to specify that an SqlConnection can only be used for ‘reads’ (i.e. Selects).

  • 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-05-27T00:04:11+00:00Added an answer on May 27, 2026 at 12:04 am

    In general I would say: Yes, you have to.

    But maybe Crystal Reports quotes the SQL-String already. Try an “attack” by yourself and see what sqlSelectStatement contains.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am on OSX Snow Leopard (10.6.2) I can install anything I need to.
I need to add a values (if anything coming into function when form is
I need a .NET regular expression that matches anything other than the exact full
I need to check to see if a variable contains anything OTHER than a-z
I need to convert a string to another which has removed anything before the
When I need some complex algorithm I first check if there's anything relevant already
I need some software to explore and modify some SQLite databases. Does anything similar
I need to integrate a email client in my current python web app. Anything
I don't need to validate that the IP address is reachable or anything like
Has anybody done anything like that? I need to import 3d objects, done in

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.