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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:24:03+00:00 2026-06-11T17:24:03+00:00

This is my first ASP.Net project. I am used to WPF . I am

  • 0

This is my first ASP.Net project. I am used to WPF. I am creating this project in Visual Studio 2010, using the C# language.
I can’t find the answer to the following question.

I have a DataGrid that needs to show all the inquiries given to that department, which is not on site. So the department needs the .Net app to get hold of the SQL Server 2008 DB. This is the code I have:
PS : I am used to loading the SQL statement into a DataTable, but it seems .Net doesn’t have it.

So what I am asking is, how do I get this method to show into the DataGrid, seeing as I can’t use the DataTable class?

: code :

SqlCommand _nuecommand = new SqlCommand();
SqlDataAdapter _nuweadapter = new SqlDataAdapter();
SqlConnection conn = new SqlConnection();

try  

{
    if (conn.State == System.Data.ConnectionState.Closed || 
        conn.State == System.Data.ConnectionState.Broken)
        {
            conn.Open();
        }

        string _sql = "";
        _nuecommand.Connection = conn;
        _sql = 
            "SELECT [Field],[Field],Field,[Field],[VeField],FieldFROM [Table]" + 
                " WHERE [Field] = 'value' AND [Field] = 'Value' AND" + 
                " [Field] IS NULL ";
        _nuecommand.CommandText = _sql;
        _nuweadapter.SelectCommand = _nuecommand;
        _nuecommand.CommandTimeout = 6000;
        _nuweadapter.Fill(_dtnuwe);
        dgnavrae.DataSource = _dtnuwe.DefaultView;
        dgnavrae.databind();

}
catch (Exception ex)
{
    LogInInde.Pages.ErrorPage._error = ex.Message;
    throw ex;
}
  • 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-06-11T17:24:04+00:00Added an answer on June 11, 2026 at 5:24 pm

    just bind data with grid view like this

    dgnavrae.DataSource = _dtnuwe.DefaultView;
    dgnavrae.DataBind();
    

    You need to user DataBind method to bind view data with gridview that will do work for you

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

Sidebar

Related Questions

I'm creating an asp.net MVC app, first time I've done this. I have a
I have an ASP.net project which involves using a custom IHttpModule. This module will
This is my first ASP.NET project and I'm stuck right away. I'm setting up
First off let me say this is my first ASP.NET project I have done.
I'm using VS2010,C#,SQL Server to develop my ASP.NET web app, although this is not
I have an existing ASP.Net MVC project that is using entities / repositories in
I am using NHibernate on a new ASP.NET project, and am running into what
I'm inherited an ASP.NET website project where they have used Windows Authentication. The admin
First, some basic details: I'm using Visual Studio 2008 Team Edition I'm using C#
I'm a senior-ish C# developer used to ASP.NET & IIS, but a project's come

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.