C# by Using Database

0 Umar Nasir · September 16, 2015
How can we use data base in c# app development
can you make video series on that
If possible than thank in advance:)

Post a Reply

Replies

Oldest  Newest  Rating
0 Brotsky Tv · September 25, 2015
Hey there !

Check out this link for better C# application with or without database:

https://usingaspdotnet.wordpress.com/
0 Wojtek Gołąb · October 13, 2015
Hey!
I'm doing this like that: 

SqlConnection con = new SqlConnection();

con.ConnectionString = "Server=" + dbIp + "\\" + dbInstance + ";DataBase=" + dbName + ";Uid=" + userName + "; Pwd=" + password + ";";

con.Open();

and now your database should be opened. 

next step is to fetch something from inside you can do it this way:

SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = query;
            cmd.CommandType = System.Data.CommandType.Text;
            var reader = cmd.ExecuteReader();

while (reader.Read())
         string s = reader.getValue(0);

I hope it will solve your problem :)
  • 1

C#

107,285 followers
About

C# is an object-oriented language designed for improving the development of web applications.

Links
Moderators