Hi All,
Am glad i found this forum, I was hit with .NET Data Provider not Found, tring to use the sqlDataSource control.
Now that I seen posting on the forum, I have moved my Data Binding into Code Behine and have uploaded the re-complied dll, but not am getting the
"System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied"
this error is thrown on line 30 (see code blow)
GoDaddy still said a script problem and not server problem, Have anybody come across this and you did you solve the problem.
Thanks for any help.
Here is my Code: default.aspx.cs
1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Web;
5 using System.Web.Security;
6 using System.Web.UI;
7 using System.Web.UI.WebControls;
8 using System.Web.UI.WebControls.WebParts;
9 using System.Web.UI.HtmlControls;
10 using MySql.Data.MySqlClient;
11
12
13 public partial class _Default : System.Web.UI.Page
14 {
15 protected void Page_Load(object sender, EventArgs e)
16 {
17 string MyConString = "Server=localhost;Port=3306;Database=mydatabase;Uid=root;Pwd='mypassword';";
18 MySqlConnection MyConnection = new MySqlConnection(MyConString);
19
20 string queryString = "SELECT * FROM tb_storelinks";
21
22 MySqlCommand MyCommand = new MySqlCommand();
23 MyCommand.CommandText = queryString;
24 MyCommand.Connection = MyConnection;
25
26 MySqlDataAdapter dataAdapter = new MySqlDataAdapter();
27 dataAdapter.SelectCommand = MyCommand;
28 System.Data.DataSet dataSet = new System.Data.DataSet();
29
30 dataAdapter.Fill(dataSet);
31
32 gView.DataSource = dataSet;
33 gView.DataBind();
34
35
36
37 }
38 }
default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div style="margin-left:auto; margin-right:auto; width:auto; ">
<h1>Test Site</h1> <p />
<asp:GridView ID="gView" runat="server" AutoGenerateColumns="False" DataKeyNames="PKID">
<Columns>
<asp:BoundField DataField="PKID" HeaderText="PKID" ReadOnly="True" SortExpression="PKID" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:BoundField DataField="ImageUrl" HeaderText="ImageUrl" SortExpression="ImageUrl" />
<asp:BoundField DataField="Importance" HeaderText="Importance" SortExpression="Importance" />
<asp:BoundField DataField="URL" HeaderText="URL" SortExpression="URL" />
</Columns>
</asp:GridView>
<br />
<asp:Label runat="server" ID="Label_Error" /></div>
</form>
</body>
</html>