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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:27:59+00:00 2026-05-22T12:27:59+00:00

I have a working process, behind a web application, that is generating some records

  • 0

I have a working process, behind a web application, that is generating some records in a table, it is so general, that I actually had to add SQL (where clause) as Data in a table.

It looks something like this (don’t mind the quotes):

 SET @sql = '(((1.00 < col_a) 
     AND (col_a < 5.00))) 
     AND NOT LEFT(col_b, 4) IN ('something') 
     OR ( CHARINDEX('cucu', col_c) > 0 ) 
     AND NOT ISNULL(col_d, '') <> '' 
     AND ((1.00 < CONVERT(FLOAT, col_e)) 
     AND (CONVERT(FLOAT, col_f)< 5.00)) 
     AND NOT col_g IN ('10') '

It works all right, no complaints, but the client would like to have an in-code approach, I am not really sure why.
So instead of using a scheduled SQL job, running my stored procedure, I guess I will make all this to be somehow rebuilt in C# desktop application, which is doing the same thing.

I would like to know if there is a way for me to use my code (like my @sql example above) somehow from C#. I mean some kind of compile, or anything.

I thought I would just select the results in a DataTable, and THEN apply my @sql over that DataTable somehow. I would like to narrow down the original DataTable’s results using that where clause.

If I don’t do something like this, I am afraid I will have to change the entire saving (of @sql) process too, which would make the task even bigger.

I am using SQL 2k5, the client has sql 2k8 (we’ll be upgrading soon) and the desktop app I would build in C#.

  • 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-22T12:28:00+00:00Added an answer on May 22, 2026 at 12:28 pm

    Do you not execute any database procs from C# currently?

    This is incredibly easy to do. Keep your SQL Code in a proc, and execute it through the SQL classes in .NET:

    http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx

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

Sidebar

Related Questions

What is the process behind making custom widgets (using Qt) that don't look...well...ugly? I
I have a working login form in an asp.net application. Standard stuff with a
I have been working on a math equation for 2 days. The whole process
We have a web service which serves small, arbitrary segments of a fixed inventory
this is for user avatar and users photo albums. I have gotten upload working
I have the following problem. I am trying to customize default TFS build process
I am working on an confirmation system, that sends a number back to the
Hey guys. Working on Mac OSX 10.6, My problem is that I would like
I am working on a project for a client and going through the initial
I've got, what I would consider, a simple test web site. A single page

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.