asp.net - sample API insert a row into a databasae...

Posted on 2011-03-08
Medium Priority
Last Modified: 2012-05-11
does anyone have a sample API..that will allow a user to insert a row into MS SQL Server DB...in VB.NET...
Question by:GlobaLevel
  • 2
  • 2
LVL 18

Accepted Solution

Anil Golamari earned 2000 total points
ID: 35073550
some thing similar to this.

 Public Function samplemethod(ByVal searchvalue As String) As string

Dim connStr As String = "Your connection string"       
Dim cmdTxt As String = "Sql query"
Dim myConn As New System.Data.SqlClient.SqlConnection(connStr)
Dim myCmd As New System.Data.SqlClient.SqlCommand(cmdTxt, myConn)
           Catch ex As Exception
               ' handle exception
           End Try
           If myConn.State = Data.ConnectionState.Open
 Then myConn.Close()
       End Function
LVL 10

Author Comment

ID: 35074032
good stuff...one quick question...after inserting the value into the db...the web service then retrieves a .mp3 file and returns it to the client and plays automatically thru a media player...is this possible?  thanks in advance...
LVL 18

Expert Comment

by:Anil Golamari
ID: 35074060
I just want to understand clearly, Here one you insert some data into sql server then your web service has to retrieve a .mp3 file and return it too client right?
LVL 10

Author Comment

ID: 35074168
I just want to understand clearly, Here one you insert some data into sql server then your web service has to retrieve a .mp3 file and return it too client right?

> correct....Im not sure if SQL Server can hold .mp3 files..or if the web server will have to pull it from a file directory off the server and return it to the client...thanks

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question