Solved

c# adding sql commands

Posted on 2011-09-20
8
245 Views
Last Modified: 2012-06-16
I having problems in added sql command in c#

what I need is to have a text box that searches a sql database and is pulls the data and displayed in datagrid view.

I have got the sql connected using the dataset the field which I am searching for is clientId which is in a table called tbl_clientaddress

0
Comment
Question by:beridius
  • 4
  • 3
8 Comments
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 36566160
post your code
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36566508
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36566519
To execute a command and to fill grid refer the link:
http://www.codeproject.com/KB/aspnet/DataGridView__GridView.aspx 
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 2

Author Comment

by:beridius
ID: 36566964
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Search : Form
    {
        public Search()
        {
            InitializeComponent();
        }



        private void customersearch_Click(object sender, EventArgs e)
        {
           
        }


        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void CleintId_TextChanged(object sender, EventArgs e)
        {

        }
        private void GetRowsByFilter()
        {
            
        }

        private void bindingSource1_CurrentChanged(object sender, EventArgs e)
        {

        }

        private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
                    }

        private void progressBar1_Click(object sender, EventArgs e)
        {

        }

        private void Search_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'interiorsDataSet1.tbl_ClientAddress' table. You can move, or remove it, as needed.
            this.tbl_ClientAddressTableAdapter.Fill(this.interiorsDataSet1.tbl_ClientAddress);
THIS IS WHERE I NEED THE SEARCH TO BE
        }
    }

Open in new window

I hope this helps
0
 
LVL 2

Accepted Solution

by:
beridius earned 0 total points
ID: 36567680
I think it should be something like

 
this.tbl_ClientAddressBindingSource.Find( 

Open in new window


but then I get stuck in what is needed

I need to find clientID which is a table called clientaddress
0
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 500 total points
ID: 36571757
ClientID is related with web application. But from your code it seems windows application. Please do clarify.
0
 
LVL 2

Author Comment

by:beridius
ID: 36573897
its a windows application sorry
0
 
LVL 2

Author Closing Comment

by:beridius
ID: 38090624
I used the syntax
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question