|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello,
I am finally back, i got a huge problem after installing vista SP1, dont install it, worst mistake ever, after installing it my computer crashed beyond recover, so after i reinstalled vista, installed C# sdk with sql 2005 express, now everything works, i am able to import all database and everything, the problem i am guessing is when i installed C# sdk, i did not install SQL with it, probably a tool to help link between the two, and later installed SQL 2005 standard edition without that link they dont know each other, no matter how much you try and point to each other, without installing SQL with C# package, it wont work, so let it be known, when installed C#, include everything!! i am fixed now thanks for everyones input and help. |
|
|||||
|
Yay!
![]() |
|
|||
|
Are you sure it wasn't just a bad connectionstring? I advice you to (learn how to) add new connections manually. It's not difficult. It's might be a bit more difficult to add data to webcontrols (if that's what you're doing), but once you understand the code and wrote it once you can just edit it for future uses. There are good tutorials for this online.
|
|
|||
|
I'm not an expert and it's been more than a year since I've used C# (needed it for school) but if I remember correctly it goes something like this using SQL server:
using System.Data.SqlClient; //Namespace SqlConnection conn = new SqlConnection( "server=myservername;database=mydatabasename;uid=m yusername;pwd=mypassword"); /* defining a SQL connection named 'conn' with the correct servername, databasename, userid and password. The thing between brackets is the connection string, there is a whole website somewhere about nothing but the connectionstring. */ conn.Open(); // open the connection SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select x from x where x";//Using your SQL command cmd.Connection = conn; string Result = (string)cmd.ExecuteScalar(); //Put the result in a string named Result Console.Writeline(Result); //Writes it in the console conn.Close(); // close the connection For multiple results you can use SqlDataReader. The framework database programming classes are referred to as ADO.NET . Look ok the internet for ADO.NET tutorials. Programming is all about managing and manipulating data, so if it's your ambition to develop professional web applications using C# and .NET for, you need to learn this stuff. If you don't know how to use SQL commands, you should learn that too. SQL Tutorial - Learn SQL is the website I learned it from. Last edited by Pancrazio; 07-02-2008 at 06:42 PM. Reason: mistake |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# with SQL database | Siten0308 | C# Programming | 6 | 06-24-2008 09:33 AM |
| Tutorial: Advanced SQL | Jordan | Tutorials | 2 | 04-07-2008 03:18 PM |
| Linking a Form to a SQL Database | newguy15 | Database & Database Programming | 2 | 12-04-2007 02:13 AM |
| Best program for SQL database manipulation | Rhadamanthys | Database & Database Programming | 3 | 07-02-2007 02:32 PM |
| Database Tuning Advisor in SQL Server 2005 | reachpradeep | Database & Database Programming | 0 | 03-03-2007 12:46 PM |
Goal: 100,000 Posts
Complete: 67%