Solved

c# adding sql commands

Posted on 2011-09-20
8
244 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET HttpWebRequest 12 58
fomat Json objects 6 28
Sum Column in GridView 3 44
C#.NET and microsoft certification. 3 34
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now