Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C# Programing FAQ - Post here
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="asachan" data-source="post: 4451218" data-attributes="member: 189916"><p><strong>There is a lot of type of connection and vast varity of DataBases are there.So here is how we can connect to a SQL database</strong></p><p><strong></strong></p><p><strong><span style="color: Green">Simple Connection Using .NET SQL DLL's</span></strong></p><p><strong>=============================</strong></p><p><strong></strong></p><p><strong><span style="color: Green">First you need to import </span></strong><span style="color: Green"><strong>SqlClient ;</strong></span></p><p><strong>=========================</strong></p><p><strong><span style="font-family: 'Courier New'">using System.Data.SqlClient;</span></strong></p><p><strong><span style="font-family: 'Courier New'"></span></strong></p><p><strong><span style="font-family: 'Courier New'"></span></strong><strong><span style="color: Green">Then you need to Create a Connection to the database</span></strong></p><p>=======================================</p><p></p><p><strong><span style="color: Green">With out Authentication</span></strong></p><p><strong><span style="color: Green">-------------------------</span></strong></p><p><strong><span style="color: Green"></span></strong><strong><span style="font-family: 'Courier New'">string conn = "server=<span style="color: Blue">KEVOL</span>;database=<span style="color: Blue">StudentInfo</span>;Integrated Security=<span style="color: Orange">true</span>"</span></strong><strong><span style="font-family: 'Courier New'">;</span></strong></p><p></p><p><span style="color: Blue">KEVOL </span>= server name;</p><p><span style="color: Blue">StudentInfo </span>= database name;</p><p></p><p></p><p><strong><span style="color: Green">With Authentication</span></strong></p><p><strong><span style="color: Green"> --------------------</span></strong>-</p><p></p><p><strong><strong><span style="font-family: 'Courier New'">string conn =</span></strong></strong> <strong><span style="font-family: 'Courier New'">server = </span></strong><span style="color: Blue"><strong><span style="font-family: 'Courier New'">KEVOL</span></strong></span><strong><span style="font-family: 'Courier New'">;database = </span></strong><span style="color: Blue"><strong><span style="font-family: 'Courier New'">StudentInfo</span></strong></span><strong><span style="font-family: 'Courier New'">;uid = <span style="color: Blue">sa</span>;pwd = <span style="color: Blue">5j55j</span>";</span></strong> </p><p><span style="color: Blue">KEVOL </span>= server name;</p><p><span style="color: Blue">StudentInfo </span>= database name;</p><p><strong><span style="font-family: 'Courier New'"><span style="color: Blue">sa</span></span></strong> = username</p><p><strong><span style="font-family: 'Courier New'"><span style="color: Blue">5j55j</span></span></strong> = Password</p><p></p><p></p><p></p><p><strong><span style="color: Green">Test your connection</span></strong></p><p><strong>====================</strong></p><p><strong></strong></p><p><strong>SqlConnection scon = new </strong><strong><strong>SqlConnection</strong></strong>(<strong><strong><strong><strong><span style="font-family: 'Courier New'">conn</span></strong></strong></strong></strong>);</p><p><strong>scon.Open();</strong></p><p><strong></strong></p><p><strong></strong><strong><strong><span style="color: Green">Compact it to one Line(Advanced stuff)</span></strong></strong></p><p><strong><strong><span style="color: Green">======================================</span></strong></strong></p><p><strong><strong><span style="color: Green"></span></strong></strong><strong>SqlConnection scon = new </strong><strong><strong>SqlConnection</strong></strong>(<strong><strong><strong><strong><span style="font-family: 'Courier New'">conn</span></strong></strong></strong></strong>)<span style="color: Green"><strong>.Open()</strong></span>;</p><p></p><p><span style="font-size: 18px"><strong><span style="color: Green"></span></strong></span></p><p><span style="font-size: 18px"><strong><span style="color: Green">To be Continue....</span></strong></span></p><p><span style="font-size: 18px"><strong><span style="color: Green"></span></strong></span></p><p><span style="font-size: 18px"><strong><span style="color: Green">Guys What do you want next??</span></strong></span></p><p><span style="font-size: 18px"><strong><span style="color: Green">Ask questions </span></strong></span></p><p><span style="font-size: 18px"><strong></strong></span></p></blockquote><p></p>
[QUOTE="asachan, post: 4451218, member: 189916"] [B]There is a lot of type of connection and vast varity of DataBases are there.So here is how we can connect to a SQL database [COLOR=Green]Simple Connection Using .NET SQL DLL's[/COLOR] ============================= [COLOR=Green]First you need to import [/COLOR][/B][COLOR=Green][B]SqlClient ;[/B][/COLOR] [B]========================= [FONT=Courier New]using System.Data.SqlClient; [/FONT][/B][B][COLOR=Green]Then you need to Create a Connection to the database[/COLOR][/B][COLOR=Green][/COLOR] ======================================= [B][COLOR=Green]With out Authentication ------------------------- [/COLOR][/B][B][FONT=Courier New]string conn = "server=[COLOR=Blue]KEVOL[/COLOR];database=[COLOR=Blue]StudentInfo[/COLOR];Integrated Security=[COLOR=Orange]true[/COLOR]"[/FONT][/B][B][FONT=Courier New];[/FONT][/B] [COLOR=Blue]KEVOL [/COLOR]= server name; [COLOR=Blue]StudentInfo [/COLOR]= database name; [B][COLOR=Green]With Authentication[/COLOR][/B] [B][COLOR=Green] --------------------[/COLOR][/B]- [B][B][FONT=Courier New]string conn =[/FONT][/B][/B] [B][FONT=Courier New]server = [/FONT][/B][COLOR=Blue][B][FONT=Courier New]KEVOL[/FONT][/B][/COLOR][B][FONT=Courier New];database = [/FONT][/B][COLOR=Blue][B][FONT=Courier New]StudentInfo[/FONT][/B][/COLOR][B][FONT=Courier New];uid = [COLOR=Blue]sa[/COLOR];pwd = [COLOR=Blue]5j55j[/COLOR]";[/FONT][/B][B][FONT=Courier New][/FONT][/B] [COLOR=Blue]KEVOL [/COLOR]= server name; [COLOR=Blue]StudentInfo [/COLOR]= database name; [B][FONT=Courier New][COLOR=Blue]sa[/COLOR][/FONT][/B] = username [B][FONT=Courier New][COLOR=Blue]5j55j[/COLOR][/FONT][/B] = Password [B][COLOR=Green]Test your connection[/COLOR] ==================== SqlConnection scon = new [/B][B][B]SqlConnection[/B][/B]([B][B][B][B][FONT=Courier New]conn[/FONT][/B][/B][/B][/B]); [B]scon.Open(); [/B][B][B][COLOR=Green]Compact it to one Line(Advanced stuff) ====================================== [/COLOR][/B][/B][B]SqlConnection scon = new [/B][B][B]SqlConnection[/B][/B]([B][B][B][B][FONT=Courier New]conn[/FONT][/B][/B][/B][/B])[COLOR=Green][B].Open()[/B][/COLOR]; [SIZE=5][B][COLOR=Green] To be Continue.... Guys What do you want next?? Ask questions [/COLOR] [/B][/SIZE] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom