Click here to Skip to main content
15,917,795 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

How to write code connection string in service getting information in database.
and bind the table. give me source code
Posted
Comments
[no name] 21-Sep-12 23:42pm    
"How to write", I generally find that using a keyboard is the best way to go. "bind the table", bind the table to what? It's a service so there is nothing to bind the table to... "getting information in database", you would go to www.connectionstrings.com to figure out the connection string for whatever database that you are using.

1 solution

Please go through How to Return a DataTable From WCF Service[^].
Download the source code (by creating an account there) and learn from that.

Another good article Asp.net WebService or Creating and Consuming WebService in asp.net or Create and call webservice in asp.net or how to create webservice and how to use webservice in asp.net[^]

Here we need to set the database connection in web.config because here I am getting database connection from web.config
XML
<connectionstrings>
<add name="dbconnection" connectionstring="Data Source=SureshDasari;Integrated Security=true;Initial Catalog=MySampleDB" />
</connectionstrings>
Thanks...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900