Solved

c# adding sql commands

Posted on 2011-09-20
8
243 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
Comment Utility
post your code
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
Comment Utility
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Accepted Solution

by:
beridius earned 0 total points
Comment Utility
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
Comment Utility
ClientID is related with web application. But from your code it seems windows application. Please do clarify.
0
 
LVL 2

Author Comment

by:beridius
Comment Utility
its a windows application sorry
0
 
LVL 2

Author Closing Comment

by:beridius
Comment Utility
I used the syntax
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

14 Experts available now in Live!

Get 1:1 Help Now