Not working in online. But working fine in offline

Posted by Thiru under ASP.NET on 9/22/2011 | Points: 10 | Views : 1330 | Status : [Member] | Replies : 2
Hi,
I am confused with a simple code to display a content in asp.net3.5

Its working fine in localhost (with local DB and also if i connect with online DB and run the application in localhost)
but its not working in online.

Here is my code:

<body>
<form id="form1" runat="server">
<div id="center_page">
<table>
<tr><td><h3><asp:Label ID="lblttl" runat="server" Text="Label"></asp:Label></h3></td></tr>
<tr><td><asp:Image ID="imgbio" runat="server" ImageUrl="" /></td></tr>
<tr><td><asp:Label ID="lblbio" runat="server" Text="Label"></asp:Label></td></tr>
</table>
</div>
</form>
</body>


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
c1.connect_dancedb()
mycon = c1.adoconn
mycon.Open()
cmd = New MySqlCommand("select * from tblbios where id='" & Request.QueryString("id") & "'", mycon)
rdr = cmd.ExecuteReader
While rdr.Read
lblttl.Text = "Team: " & rdr("teamnm") & "<br><br>" & "Bio: " & rdr("nm")
lblbio.Text = rdr("bio")
imgbio.ImageUrl = "~/imgbio/" & rdr("imgpath")
End While
mycon.Close()

Catch ex As Exception

End Try
End Sub





Responses

Posted by: Ndebata on: 9/22/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Thiru,

What do you mean by online db. can you connect to that db from your local machine, try to connect that remote database from your local machine. There might be some sort of firewall.

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thiru on: 9/23/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
I already mention that i can able to connect from my local machine - and its working fine.
but in online its just showing:

Label

Label


If i connect that DataBase in server and running my application in local maching - its working fine.
i mean its showing the result i expected.

Exact Content from DB
Image


Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response