How to get data from sql database to textbox directly in c# using connectionstring

Sdílet
Vložit
  • čas přidán 9. 02. 2019
  • This tutorial is display data from sql server database table to textbox dynamically in c# windows form application using connectionstring easily. i have written the code in textbox textchanged event.
    This is when you just write the ID in textbox1 in windows form, it display name and age in textbox2 and textbox3 from sql server database table.
    CRUD operation. Insert update delete search in sql go to this link.
    • CRUD Operation in C# W...
    ~~~~~~~~~~~~~
    Subscriber will be notified when I will upload new tutorials in future. Many more new tutorials coming soon, so stay tuned!
    / swiftlearn
    ~~~~~~~~~~~~~
    You can also know all the programming techniques, and bug fixing, error solution in my channel Swift learn.
    The main topics of this cnannel are c#.net, asp.net, WCF, sql server, crystal report, RDLC report, HTML, CSS, javascript, Android etc.
    ~~~~~~~~~~~~~
    Share this video with anyone if you think as useful.
    Please leave any suggestions for future tutorials in the comment section below.
    ~~~~~~~~~~~~~
    Connect with me
    / swiftlearn
    All playlist
    c# tutorial for beginners Swift Learn
    • c# tutorial for beginners
    c# linq to sql tutorial Swift Learn
    • c# linq to sql tutorial
    asp.net tutorial for beginners full Swift Learn
    • asp.net tutorial for b...
    crystal report c# in sql Swift Learn
    • crystal report c# in sql
    RDLC Report tutorial
    • rdlc report in asp.net c#
    SQL Tutorial for beginners full Swift Learn
    • sql tutorial for begin...
    HTML tutorial full course
    • how to add background ...
    WCF Tutorial Step By Step with SQL
    • WCF Tutorial Step by S...
    for details
    #GetTexDirectlyFromDatabase #GetDataFromSqlToTextbox #DisplayTextInTextbox
    swift learn,how to display data in textbox from database in c#,display data from database in c#,get text directly from database,get text directly from database to textbox,display text in textbox c#,how to display data from sql database to textbox using c#.net,get text in textbox c#,display text in textbox dynamically in c#,text box in c#,how to,get data from sql to textbox c#
  • Věda a technologie

Komentáře • 83

  • @FarhanKhan-io3vt
    @FarhanKhan-io3vt Před 3 lety +6

    Thank you yaar searching since 2 3 days now i got perfect solution for my cod💞

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      You are very kind. Thanks for your comment.

    • @sabaansari1561
      @sabaansari1561 Před rokem

      Thank you but in this video in sql yog
      Cannection throw video plese

  • @aminaali5905
    @aminaali5905 Před 5 lety +2

    Very helpful tutorial. thanks for uploading.

  • @kaleeswaris9418
    @kaleeswaris9418 Před rokem

    Very short and clear thanks a lot

  • @salazarfiore
    @salazarfiore Před 2 lety

    YOU ARE AMAZING. Thank you for this

  • @avprn338
    @avprn338 Před 4 lety +4

    Thank you so much man! God bless you!

  • @globalinvest9275
    @globalinvest9275 Před 5 lety +1

    Awesome tutorial in short video. I always like this types of video.

  • @rishithapremachandra9911
    @rishithapremachandra9911 Před 4 lety +1

    Awesome tutorial. Thanks a lot!

  • @premier1888
    @premier1888 Před 4 měsíci +1

    Thanks for sharing such helpful tutorial.

  • @NotNazuh
    @NotNazuh Před 2 lety

    Im not even gonna lie I watched this an hour ago and i didn't do it right and it didn't work so I got mad at that and re-watched it again and it was clear as day.

  • @jomarierola852
    @jomarierola852 Před 4 lety +1

    Thanks this is very helpful to my program!!

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      Thanks for your comment. Please keep connected.

  • @flauberttagu
    @flauberttagu Před 3 lety +1

    Thank you for the knowledge. Great video. 👌👍

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      Glad it was helpful! its my pleasure.

  • @coralch1
    @coralch1 Před 4 lety +1

    Thanks man! It helped a lot!

  • @marinmato3500
    @marinmato3500 Před 3 lety

    Thank you so much! Very helpful!

  • @lizastepantsova5230
    @lizastepantsova5230 Před 3 lety +1

    Oh my god, thank you so much for your video. I can finally finish my coursework T_T

  • @manalafriad1736
    @manalafriad1736 Před 4 lety

    you saved my life! thank you!

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      Glad to hear that! Please keep connected.

  • @user-om2pg2hu9b
    @user-om2pg2hu9b Před 6 měsíci

    Thnak You very much mere bhai

  • @bushra3397
    @bushra3397 Před 3 lety +1

    Thank you so much😍😍it worked👍👍🎊

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      You're very kind. please keep in touch.

  • @_SangeethSahanaD
    @_SangeethSahanaD Před 2 lety +1

    After entering ID, I'm getting the respective Name and Age in textbox , only after hitting enter or insert button, I'm not getting the name and age dynamically while giving the ID in textBox

  • @adolforosena7961
    @adolforosena7961 Před 4 lety

    Thanks a lot! Thumbs up!

  • @avinashhiradodde7246
    @avinashhiradodde7246 Před 3 lety +1

    lovely video sir thank you so much ❣️❣️❣️❣️❣️🙏🙏🙏🙏👌👌👌👌

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      You are very kind. Thanks for your comments. Please keep in touch!

  • @thusharapriyakalum3834
    @thusharapriyakalum3834 Před 6 měsíci

    ❤❤❤ thank you

  • @elizabethgrant6018
    @elizabethgrant6018 Před 3 lety +1

    Thank you so much sir!

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      You are very kind. Thanks for your comment.

  • @Liqydator
    @Liqydator Před 4 lety +1

    thank you very much, dude

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      You're welcome! pleased to see your comment.

  • @saulrivera4142
    @saulrivera4142 Před 2 lety

    I created a class and set a method using your example, it returns the value I want but I can't find a way to show it in my tex box

  • @differentsee9314
    @differentsee9314 Před 3 lety

    Life saving ❤😥

  • @SharmaJiDe
    @SharmaJiDe Před rokem

    hey i am facing an isssue when i am trying to fetch the text using this methond can u help !!

  • @ecstatic6133
    @ecstatic6133 Před 3 lety

    Thumbs Up!

  • @DeathReis
    @DeathReis Před 3 lety

    Thanks man

  • @KelvinMakumi
    @KelvinMakumi Před měsícem

    Very helpful thank you

    • @SwiftLearn
      @SwiftLearn  Před měsícem

      Glad it was helpful! You are very kind. Please keep connected.

  • @andi_reza
    @andi_reza Před 3 lety +1

    Thank you for your tutorial. I have a question. how to insert the data if it has same id or one id have a record more than one?

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      add a SL in primary key column and Remove Primary key from ID column or Create a child table

  • @awaanibacha6345
    @awaanibacha6345 Před 11 měsíci

    Nice sir

  • @yathutheva2996
    @yathutheva2996 Před 3 lety +1

    awesome tutorial

  • @user-lt6et8xw1f
    @user-lt6et8xw1f Před 2 lety +1

    Thenk You very match pro

    • @SwiftLearn
      @SwiftLearn  Před 2 lety

      Thank you too. Please keep connected.

  • @salmanluxe800
    @salmanluxe800 Před 3 lety +1

    thank you bro

    • @SwiftLearn
      @SwiftLearn  Před 3 lety +1

      Thanks for your comment. you are very kind.

  • @jakkjs3290
    @jakkjs3290 Před 3 lety +1

    hi i want search in string value not int so what i doing text value is vchar could you help me

    • @SwiftLearn
      @SwiftLearn  Před 3 lety

      You can use varchar(100) or nvarchar(100) for string value. Thanks

  • @jagadishpatil1022
    @jagadishpatil1022 Před 3 lety +1

    can you plz help me for this error
    Cannot implicitly convert type 'System.Data.SqlClient.SqlDataReader' to 'System.Data.SqlClient.SqlDataAdapter'

    • @SwiftLearn
      @SwiftLearn  Před 3 lety +1

      try with SqlDataReader. if not work try with SqlDataAdapter. one of them will work. thanks

  • @dsdassdasdasda6959
    @dsdassdasdasda6959 Před 3 lety

    How to just show all the datas inside the table? I just need a simple thing not search button..

  • @ramsgarageband5784
    @ramsgarageband5784 Před 3 lety

    That details I wanna urgently thanks sir

  • @vamsidhar2927
    @vamsidhar2927 Před 3 lety +1

    i want Mvc pleae Provide Mvc Code

  • @yasserfatheddine5057
    @yasserfatheddine5057 Před 3 lety

    ❤❤

  • @zerosandones7547
    @zerosandones7547 Před 5 lety +3

    where do you learn these? I haven't found any documentation about this :( Im still a beginner, can you help me?

    • @SwiftLearn
      @SwiftLearn  Před 5 lety

      Sure. you can do it easily using linq. czcams.com/video/9r65Zf0ZZko/video.html

  • @anonnymous1411
    @anonnymous1411 Před 4 lety +1

    Sir I am getting this error What should I do Please Reply (I'm A begginer)(I'll leave my Code in Next Comment ) -
    System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)'

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      It means your SQL connection error. i mean your application can not connect with sql server database. check your connection string. thanks.

  • @guutuugaashuu1654
    @guutuugaashuu1654 Před 4 lety +1

    ADD or SUBSTRACT or MULTIPLY between two Table or form C#

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      you can do it easily in SQL Command. thanks.

  • @iangabrielalcantara7756
    @iangabrielalcantara7756 Před 2 lety +1

    How about with stored procedure?

    • @SwiftLearn
      @SwiftLearn  Před 2 lety

      Thanks for your comment. Please visit this link to watch about Stored Procedure czcams.com/video/C7ukAjQtsxE/video.html

  • @johnmielemoricha8645
    @johnmielemoricha8645 Před 2 lety +1

    Is there other way to get data without using connection string?

    • @SwiftLearn
      @SwiftLearn  Před 2 lety

      You can use linq to sql class instead of connectionString. see this czcams.com/video/2Sc_m2c0tOA/video.html

  • @peshmarga.wpeshmarga.w6550

    🌹♥

  • @amartalents7099
    @amartalents7099 Před 2 lety +1

    Hi sir. Please show me this design page sir. Please

    • @SwiftLearn
      @SwiftLearn  Před 2 lety

      Visit this link to see full tutorial. czcams.com/video/aer8S1fFbNc/video.html thanks

  • @anonnymous1411
    @anonnymous1411 Před 4 lety +1

    Please tell me what's Wrong Here-
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using System.Configuration;
    namespace sqlC_sharp_connection
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
    }
    private void button1_Click(object sender, EventArgs e)
    {
    SqlConnection con = new SqlConnection("server=localhost;user id=root;persistsecurityinfo=True;database=shreeram");
    con.Open();
    SqlCommand cmd = new SqlCommand("Select usr_type from sample Where id=3");
    SqlDataReader dr = cmd.ExecuteReader();
    while(dr.Read())
    {
    txt.Text = dr.GetValue(0).ToString();
    }
    con.Close();
    }
    }
    }

    • @SwiftLearn
      @SwiftLearn  Před 4 lety

      First of all check connection. then
      try with
      SqlCommand cmd = new SqlCommand("Select id, usr_type from sample Where id=3");
      SqlDataReader dr = cmd.ExecuteReader();
      while(dr.Read())
      {
      txt.Text = dr.GetValue(1).ToString();
      }
      and tell me the error message. thanks

  • @namankhulbey5833
    @namankhulbey5833 Před 4 lety +1

    Get bhelu?