0

i am a newbiest of c#, i need to write a webs service in C#. However i meet some problem

  1. how to connect the database that i create in the visualstudio ( i click on the server explorer tab, right click on the data connection and click on create new sql server data) with the web service
  2. where should i call the data out from the database at?

really urgently...relpy asap....hope anyone can tell me the answer in the short period of time

if can show some examples or codes of this

2 Answers 2

1

You can use linq-to-sql as a rapid solution.

Just add a new Item "LINQ to Sql Classes" to your project. Drag your tables into designer and you have the equivalent classes. Using LINQ is too simple. Just google for every scenario and you will find tones of samples.

LINQ 101 examples

LINQ Introduction for VB

LINQ samples for VB

Sign up to request clarification or add additional context in comments.

4 Comments

for vb, need to add connection,beside using this, is there other ways
You have to add connection. Of course you can replace the design-time connection with another in runtime. Just pass the connection string to the subclass of DataContext which is created for your project.
dont really get you ?can show me? is put in where but i thought c# there no sub'
but i need c#, i know how to create web service in vb but i dont know how to change to c#
0

Take a look at some LINQ examples.

1 Comment

can show me where or show some code...cause i don't know this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.