Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Data Access From SQL SERVER to Asp.net Application

Data Access From SQL SERVER to Asp.net Application

Scheduled Pinned Locked Moved ASP.NET
questiondatabasecsharpasp-netsql-server
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shuja082
    wrote on last edited by
    #1

    Dear All, I have a question regarding data access from SQL server 2008 to Asp.net 4.0 application... My question is what is the best method to get data from SQL Server, Table, View, Stored Procedure, function.. My Problem, why I am asking this question, I want to access data from Stored Procedures and I have to define parameters on creation time of procedures and have to use them all in asp.net form to access data. But I want to give rights to user, get data with nos of parameter if he wants to use otherwise no filter all data would be displayed... and he has right to use all filters or no filter or whatever that is defined. So in this situation what would you guys recommend to get data from SQL using Stored Procedure, Tables or Views and how is that possible? Thanks in advance for your reply Shuja

    C 1 Reply Last reply
    0
    • S shuja082

      Dear All, I have a question regarding data access from SQL server 2008 to Asp.net 4.0 application... My question is what is the best method to get data from SQL Server, Table, View, Stored Procedure, function.. My Problem, why I am asking this question, I want to access data from Stored Procedures and I have to define parameters on creation time of procedures and have to use them all in asp.net form to access data. But I want to give rights to user, get data with nos of parameter if he wants to use otherwise no filter all data would be displayed... and he has right to use all filters or no filter or whatever that is defined. So in this situation what would you guys recommend to get data from SQL using Stored Procedure, Tables or Views and how is that possible? Thanks in advance for your reply Shuja

      C Offline
      C Offline
      chester_it21
      wrote on last edited by
      #2

      hi Shuja, at its base is all activities when using Parameter Stored Procedure, we must define its parameters simultaneously dengna making its Stored Procedure. using LINQ or the Code definition ConnectionsClass (SqlClient, ODBC, OleDb etc. ..), its all the same to use parameters. but if you want to save the program code, you can make it with a parsing technique parameters such as the example below: in SP,

      ALTER PROCEDURE [dbo]. [GET_SALER_ORDER]
      (
      @ SALESNAME VARCHAR (20)
      )
      U.S.
      SELECT * FROM WHERE TABLE_SALES SALES_NAME LIKE @ SALESNAME

      and in its asp.net code, you can call him by implanting code like this:

      salesname var = "%" + parsingsalesnamevalue + "%";

      var sqlcmd = new SqlCommand ("GET_SALER_ORDER", sqlcon);

      sqlcmd.CommandType = CommandType.StoredProcedure;
                   sqlcmd.Parameters.AddWithValue ("@ SALESNAME", salesname);

      This means, if the value of its parsingsalesnamevalue empty, meaning the application code to call the data without the filter, if its opposite, meaning the application code to filter based salesname. is this what you mean, or you can tell me more detail about your wishes, hope this helps as a prefix you in building your applications

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups