Hi,
I am a beginner in C# and SQL Database 2005.
Let me know how to access a Database and get the data into a C# structures.I dont need the code.i Just need directions.
Thanks in Advance.
How do u access a Database using a C# structure
Page 1 of 13 Replies - 1070 Views - Last Post: 13 March 2009 - 05:01 AM
Replies To: How do u access a Database using a C# structure
#2
Re: How do u access a Database using a C# structure
Posted 13 March 2009 - 03:27 AM
soumyasurya, on 13 Mar, 2009 - 02:15 AM, said:
Hi,
I am a beginner in C# and SQL Database 2005.
Let me know how to access a Database and get the data into a C# structures.I dont need the code.i Just need directions.
Thanks in Advance.
I am a beginner in C# and SQL Database 2005.
Let me know how to access a Database and get the data into a C# structures.I dont need the code.i Just need directions.
Thanks in Advance.
SqlConnection oConn = new SqlConnection(configurationManager.Connectionstring["Here Put ur Connection string name"].connectionStrings);
SqlCommand oCommd = new SqlCommand("Write any Query",oConn);
oConn.Open();
oCommnd.ExecuteNonQuery();
oConn.Close();
SqlDataAdapter oDA = new SqlDataAdapter(oCommd);
DataTable oDT = new DataTable();
oDA.Fill(oDT);
[How u get connection string? Here r steps....]
1) just make table in MSsql server 2005 and drag & drop on to ur design Page , then open the source , copy connection string name and paste on above..
*** MOD EDIT: Added code tags. Please
This post has been edited by JackOfAllTrades: 13 March 2009 - 05:02 AM
#3
Re: How do u access a Database using a C# structure
Posted 13 March 2009 - 03:45 AM
ErPriyansh, on 13 Mar, 2009 - 02:27 AM, said:
soumyasurya, on 13 Mar, 2009 - 02:15 AM, said:
Hi,
I am a beginner in C# and SQL Database 2005.
Let me know how to access a Database and get the data into a C# structures.I dont need the code.i Just need directions.
Thanks in Advance.
I am a beginner in C# and SQL Database 2005.
Let me know how to access a Database and get the data into a C# structures.I dont need the code.i Just need directions.
Thanks in Advance.
SqlConnection oConn = new SqlConnection(configurationManager.Connectionstring["Here Put ur Connection string name"].connectionStrings);
SqlCommand oCommd = new SqlCommand("Write any Query",oConn);
oConn.Open();
oCommnd.ExecuteNonQuery();
oConn.Close();
SqlDataAdapter oDA = new SqlDataAdapter(oCommd);
DataTable oDT = new DataTable();
oDA.Fill(oDT);
[How u get connection string? Here r steps....]
1) just make table in MSsql server 2005 and drag & drop on to ur design Page , then open the source , copy connection string name and paste on above..
Hi,
I am able to coonection to the Database but my problem is how do u get the data from database in a ArrayList.And how do u perform basic updation,deletion and insertion on the Database.
#4
Re: How do u access a Database using a C# structure
Posted 13 March 2009 - 05:01 AM
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Post your code like this:
Thanks.
Post your code like this:
Thanks.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|