ADO.NET :: How To Get And Write Data To A DB Located On The Server
Jan 2, 2011
I have a silverlight client that i want to get and write data to a DB located on the server . now this is what i did :
1. created the silverlight projecte hosted in asp site project, with wcf enabled .
2. created a DB with some tables in it.
3. created linq to sql classes, and wcf service with operation to fetch data from the DB, added the project the referance .
result:
when i debug it locally on localhost, it workes perfectly, but when i upload all the content to the server i get an error, my guess is that the service is not finding the DB . after I uploaded the content, all i did was change the connection string in my web.config file to the one provided to me by the hosting server.
exception:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Fri, 31 Dec 2010 12:11:43 UTC
Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at MyProfile.ServiceReference1.GetMessagesCompletedEventArgs.get_Result()
at MyProfile.MainPage.webService_GetMessagesCompleted(Object sender, GetMessagesCompletedEventArgs e)
at MyProfile.ServiceReference1.ServiceClient.OnGetMessagesCompleted(Object state)
Line: 1
Char: 1
Code: 0
View 3 Replies
Similar Messages:
Jan 14, 2010
I am trying to post data from vb.net application to web service asmx that is located on server! For posting data from vb.net application I am using this code:
Public Function Post(ByVal url As String, ByVal data As String) As String
Dim vystup As String = Nothing
Try
'Our postvars
Dim buffer As Byte() = Encoding.ASCII.GetBytes(data)
'Initialisation, we use localhost, change if appliable
Dim WebReq As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
'Our method is post, otherwise the buffer (postvars) would be useless
WebReq.Method = "POST"
'We use form contentType, for the postvars.
WebReq.ContentType = "application/x-www-form-urlencoded"
'The length of the buffer (postvars) is used as contentlength.
WebReq.ContentLength = buffer.Length
'We open a stream for writing the postvars
Dim PostData As Stream = WebReq.GetRequestStream()
'Now we write, and afterwards, we close. Closing is always important!
PostData.Write(buffer, 0, buffer.Length)
PostData.Close()
'Get the response handle, we have no true response yet!
Dim WebResp As HttpWebResponse = DirectCast(WebReq.GetResponse(), HttpWebResponse)
'Let's show some information about the response
Console.WriteLine(WebResp.StatusCode)
Console.WriteLine(WebResp.Server)
'Now, we read the response (the string), and output it.
Dim Answer As Stream = WebResp.GetResponseStream()
Dim _Answer As New StreamReader(Answer)
'Congratulations, you just requested your first POST page, you
'can now start logging into most login forms, with your application
'Or other examples.
vystup = _Answer.ReadToEnd()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Return vystup.Trim() & vbLf
End Function
View 1 Replies
Feb 17, 2010
Is there anything missing in IIS 6.0 that prevents me from (Insert into table) using MS-Access?
Explain: The application works fine under Visual Studio 2008 IDE the insert into table works fine with no error, Also I tested with hosting provider and works fine with no problem. but now I have published the same exact app in a dedicated server windows 2003 with
IIS 6.0 .NET framework 2.0 with latest service pack I gave IIS_WPG write/modify access to the folder where MS-Access database is located and database but at the time of insert an error pop-up. I need to install in the Server or settings in the IIS to recognize my MS-Access db is it some office runtime that I am missing. (BTW I am using OLEDB connection string in my C# )
Using System.Data.OleDb;
I can retrieve data off of it with no problem but when I try to insert is when it fails I thought the problem was Access Rights but I do not think is the case.
View 4 Replies
Aug 15, 2010
I am trying to attach my database to Microsoft SQL Server Management... I right clicked on Database -> Add and then tried to look into the directory however I cannot expand the directory and when I use the exact hyperlink [...]httpdocsApp_DataurantitDB.mdf
I get an error message of Inetpubvhost[...]httpdocsApp_Dataurantit.mdf failed with the operating system error 5(Access is denied). (Microsoft SQL Server, Error: 5133)
View 3 Replies
May 14, 2010
I am running an exe file located at Server named Wget (Command line Web Crawler) using aps.net application.
When I run it from Visual Studio Development environment it run properly and gives required results.
But when I run it from the IIS Server its process run properly but terminated immediately and doesn't give required results and there is no any kind of exception.
View 3 Replies
Jan 10, 2011
I'm very new to silverlight and I'm trying to play a video located in the web project associated with my silverlight application.
What is the best way to get the URI of videos located on the server without hard coding the web address?
View 2 Replies
Apr 13, 2010
I've got a ASP.NET site that's located on a local server (MY_SERVER). And one of the things it does is pull up tiff files which are located on another server (ANOTHER_SERVER). The location of each of these files is stored in SQL. I pull up each of these images and am supposed to display them. The problem is:
the files are not named with a tiff extension (does it matter?) they aren't displaying at all.
I am using an Image control to display these images, and I'm not sure if it matters that the extension is not set (does the image control know the difference between an jpg and a tiff without the extension?)
I am guessing the images aren't displaying because they are not on the same server MY_SERVER that the images are located (ANOTHER_SERVER).
edit: actually displaying the tiff files were amazingly simple:
protected void Page_Load(object sender, EventArgs e)
Response.ContentType = "image/png";
new Bitmap(Request.QueryString["ImagePath"]).Save(Response.OutputStream, ImageFormat.Gif);
}
but because the images are located on ANOTHER_SERVER I still can't access them. I may just do a hack where I copy them to a local directory on MY_SERVER but there's gotta be a simple way to fix this. Anyone?
View 3 Replies
Jun 2, 2010
I want to show .nfo file to user.That nfo file is located on server and i am giving it's path in crystal report.
So, when user click on that path of nfo file in crystal report, i want to show that file to user.
I cannot open nfo file in browser.I got this error,
HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I am using .net3.5 and iis7.
View 3 Replies
May 21, 2010
I want to grant access to some ressources located on server only for specified web pages, how could I do this?
For example I have an image www.mysite.com/images/image.jpg and something like <img src="www.mysite.com/images/image.jpg" /> should only work on site asp.net.
Is it possible with web.config or maybe with some C# code?
View 4 Replies
Dec 22, 2010
I have a project that must illustrate that connection to the database is not locally, so I have install VirtualBox and I intend to install SQL Server on it. So any one have the idea of how can I connect from the Host Machine to the SQL Server located on the Virtual Machine
View 3 Replies
Dec 23, 2015
I would like to work with NLog to track my application's events.How i can configure the generated log file if my server is located on Azure?
View 1 Replies
Jun 21, 2010
I create a user control named ExampleControl and add <%@ Register src="ExampleControl.ascx" tagname="ExampleControl" tagprefix="uc1" %> to aa.aspx file So I can use ExampleControl cw = Panel1.FindControl("ExampleControl1") as ExampleControl in the file aa.aspx.cs
Now I hope to use ExampleControl cw = Panel1.FindControl("ExampleControl1") as ExampleControl in a .CS file located App_Code folder, but I get the following error, how can I do?
Error 4 The type or namespace name 'ExampleControl' could not be found (are you missing a using directive or an assembly reference?)
View 1 Replies
Nov 3, 2010
I'm working on an ecommerce project that is missing 5,000 product pictures.
I am trying to assign all products without pictures into a category located on a mapping table.
I know an insert can be accomplished from one table (or subquery) to another but I only need to find the product IDs and insert them with default values into the category mapping table that has all non-null columns.
The following code is the farthest I can get without help (I'm not strong in SQL), it won't work because my subquery returns many rows while the SQL statement is designed to insert one - I don't know how to handle this...
[Code]....
Any help would be appreciated from those more experienced than I. BTW... there are no known search results for this type of solution - if there is even a solution.
View 2 Replies
Oct 1, 2010
Suppose we want to select the data from the database then we write the query for that. Example:
SqlConnection con=new SqlConnection(Connetion name) string selectPkId = @"SELECT PK_ID FROM TABLE" SqlCommand cmd=new SqlCommand(selectPkId ,con);
So,my question is that why we basically use @ before the sql query.If I don't use @ before that then it again work fine (does not give any error), then what is need of using "@"?
View 1 Replies
Jan 28, 2010
I have to write data from excel to data table on my server and ms office is not installed on the server. I am able to save the excel file but I don't how I can write it to data table from excel when ms office is not installed.
View 3 Replies
Oct 13, 2010
How to write Stored Procedure for Insert Data & Execute it in MS SQL?
Some websites:
[URL]
View 4 Replies
Jan 4, 2010
i am using amazon s3 service. now i want to show download dialog box in my asp.net application when user come on download page. i am using amazon sdk.
View 1 Replies
Jun 30, 2010
I am about to write a method that uses SQLParameter to insert some data into SQL server. However, do I "have" to specify a DBType? If not how is this handled?
Here is an example of the code I intend to write:
[Code]....
View 6 Replies
Nov 21, 2010
I have a gridview which displays thumbnails in the first column and details in the other columns. The thumbnail URL is being retrieved using the following:
[Code]....
However, if the thumbnail cannot be located, a white box with a cross appears instead (as expected).
To handle this better, I would like to display a different image if the thumbnail cannot be located for any reason, for example an image saying "Image Cannot Be Displayed". But I am unsure of how to do this, of even where to do this. Essentially I need to assess the value that the datagrid is using for the particular URL when it is databound. But can I put VB.NET code in this?
View 9 Replies
Nov 23, 2010
how can I create stored procedure and write my select statement in it, I know how to create dataset then put type stored procedure and assign it to the sp ... what I want is writing my sp... how can I make it ?
check the following code, this is what I want to write put I don't know where or how !
CREATE STORED PROCEDURE SP_CATEGORY
@CATEGORY VARCHAR(30)
AS
BEGIN
SELECT LATIN_NAME, ENGLISH_NAME, ARABIC_NAME, CATEGORY
FROM FLORA, CATEGORY_LIST
WHERE FLORA.CATEGORY=CATEGORY_LIST.CATEGORY_NAME AND CATEGORY_LIST.CATEGORY_NAME IN (SELECT * FROM SPLITLIST(@CATEGORY, ','))
END
where can I write this code ?!
View 5 Replies
Jun 12, 2010
how can we write a code for displaying a files and folders of server directory using Grid View in asp.net?
View 3 Replies
Jul 22, 2010
I wish to add a sub to vb file that changes the display value of several asp:panels located in a Formview Item Template. My only question is what is the proper event to run this in. (databound, item created etc...) If it matters this formview appears in a Gridview Item Template.
View 7 Replies
May 25, 2010
i got a Gridview which is bound and draws its values from a DataTable.
My question is how can i sum the values of the p_price column and view the result on a label located on the same page?
View 2 Replies
Jan 17, 2011
I have to write a application which connects to remote server(windows 2003 server, open SQL Management studio in that server and enter a specific SQL Server address and access a stored procedure, change some values and execute the stored procedure.)
I have to write this application using C#.Net , Could anybody point me in right direction, Where do I start?
View 6 Replies
Oct 12, 2010
I am using Sql Server 2005,My table structure is below.
Create Table ComentTable(id int,coments varchar(4000))
insert into ComentTable values(1,'sanjay I don%27t Know Tamil Language')
insert into ComentTable values(1,'sanjay I don%27t Know Kanar Language')
how to write storeprocedure update coments column replace %27 to '
View 4 Replies