views:

37

answers:

4

I cannot remember the site, but I showed parameter add etc where we could add the name of parameters instead of forming the whole query as a single statement

Please suggest some good links having coding info for working with SQL Server tables using C# website, following needed most

  • create table
  • insert data
  • delete data
  • declare primary key
  • declare foreign key
+1  A: 

Microsoft's Data Access Application Block is useful:

http://msdn.microsoft.com/en-us/library/ff649538.aspx

However, I can't think of an example of a time that I would want to create tables or keys from a website. Just a thought.

Mark Avenius
+1. Not bad. More learning curve, but a good tool to use. I like the Patterns and Practices libraries, and we use teh Data Access Applicaiton Block in several of our live apps.
David Stratton
It's no uncommon for distributed apps. E.g. the installation script for an open source project would very possibly have creates and accept parameters from a form the user fills out.
Kevin Nelson
+1  A: 

Try these:

David Hayden has a great long list on various free tutorials - amongst them a long list of ADO.NET tutorials, too. C# Corner also sports such a long list of articles, blog posts, and tutorials on ADO.NET.

marc_s
+2  A: 

You can also go to www.w3shcools.com. Here you will find everything you need.Well i suggest you to use the stored procedures instead of sql querries,because of sqlinjection.Moreover stored procedures are fast to execute.

sabby
but i need parameter passing at run time, will stored procedures allow that,? an example please
Well bro stored procedure is stored in the server and executed once.So you just need to fetch the data,while in case of querries ,it is executed each time and posted to server.Yes you can pass parameters at run time. you just need to create procedure and call that at run time to insert the value, or the method from where you want to pass the value.Suppose you are using a datagrid in .net,That allow you all the funtionalities of updating,deleting,inserting,saving the data.You could insert data in grid at run time and save that in database.
sabby
And one more thing use sqldataAdapter.A data adapter contains a reference to the connection object and opens and closes the connection automatically when reading from or writing to the database. Additionally, the data adapter contains command object references for SELECT, INSERT, UPDATE, and DELETE operations on the data. You will have a data adapter defined for each table in a DataSet and it will take care of all communication with the database for you. All you need to do is tell the data adapter when to load from or write to the database.
sabby
+2  A: 

http://www.codeproject.com/KB/database/DatabaseAcessWithAdoNet1.aspx

Go through this link.You will get idea how to access the storep.

sabby