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. General Programming
  3. C#
  4. Dataset Designer using it programmatically?

Dataset Designer using it programmatically?

Scheduled Pinned Locked Moved C#
questiondatabase
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.
  • T Offline
    T Offline
    tkrn
    wrote on last edited by
    #1

    I am using an extensive dataset that was designed through the graphical dataset designer, how do i call a method(query) from that dataset programmatically? thanks

    N 1 Reply Last reply
    0
    • T tkrn

      I am using an extensive dataset that was designed through the graphical dataset designer, how do i call a method(query) from that dataset programmatically? thanks

      N Offline
      N Offline
      nelsonpaixao
      wrote on last edited by
      #2

      Do you want to get data from a database and display in your application datagridview? // this is a routine i wrote public static void SP_WITH_DATAGRIDVIEW(string SP, DataGridView DATAGRIDVIEW_X, string PARAMETER_NAME1, SqlDbType SQLDBTYPE1, object OBJECT1, string PARAMETER_NAME2, SqlDbType SQLDBTYPE2, object OBJECT2) { SqlConnection conn = new SqlConnection(your_connection_string); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = SP; cmd.CommandType = CommandType.StoredProcedure; // how many parameters to you have? here is 2, and of what kind? cmd.Parameters.Add(PARAMETER_NAME1, SQLDBTYPE1).Value = OBJECT1; cmd.Parameters.Add(PARAMETER_NAME2, SQLDBTYPE2).Value = OBJECT2; conn.Open(); SqlDataAdapter sql_da = new SqlDataAdapter(); sql_da.SelectCommand = cmd; DataTable dt = new DataTable(); sql_da.Fill(dt); conn.Close(); DATAGRIDVIEW_X.DataSource = dt; } Good luck!!!:cool:

      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