473,378 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Getting a DNS error, can someone help - please?

Below is my code for dropdownlist that is populated from a SQL table.
After a selection from the ddl, a datagrid is suppose to come up
pertaining to the information selected, but I keep getting a DNS
error. I developed this "simple" page but so far it is not simple!
argh!

<%@ Page Language="VB" Debug="true" Explicit="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SQLClient" %>
<script runat="server">

Dim strConn as string =
"server=abcdserver;database=acct_payable;trusted_c onnection=true"

Sub Page_Load(Source as Object, E as EventArgs)
if not Page.IsPostBack then
doData()
end if
End Sub


Sub doQuery(Source as Object, E as EventArgs)
'Sub doQuery is for the datagrid
'This may be the source of DSN errors - the sql statement
Dim supname as string
Dim MySQL = "SELECT splr_name, splr_name, splr_addr, " & _
"splr_city FROM tbl_ap_vendors WHERE splr_name='" & supname &
"'"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"tbl_ap_vendors")

'MyDataGrid is for the datagrid to fill
MyDataGrid.Datasource=ds.Tables("tbl_ap_vendors"). DefaultView
MyDataGrid.DataBind()
End Sub
Sub doData()
'Sub doData is for the dropdownlist
Dim strSQL =
"server=abcdserver;database=acct_payable;trusted_c onnection=true"

Dim Conn as new SQLconnection(strConn)
strSQL = "select splr_name from tbl_ap_vendors ORDER BY
splr_name"
Dim Cmd as New SQLCommand(strSQL,Conn)
Conn.Open()
MyDropDownList.DataSource = Cmd.ExecuteReader()
MyDropDownList.DataBind()
End Sub
Function FixDR (sItem) as String
'Function FixDR is for null fields
if Not sItem is System.DBNull.Value then FixDR=sItem
End Function

</script>
<html>
<head>

<title>Testing a dropdownlist and datagrid</title>
</head>
<body>
<Form id="form1" runat="server">
<div align="center"><table> <tr>

</tr>
<tr>
<!-- HTML code to display the DropDownList on the screen for user
input
list is populated by a SQL table and selection bring up DataGrid -->
<td align="center" valign="Top" Colspan="2"><hr>
<b><i><font Color="#0000FF">Using a DropDownList and a
DataGrid:</font></i></b>
<asp:DropDownList id="MyDropDownList" datatextfield="splr_name"
runat="server" />
<asp:Button id="button" Text="Select Supplier Name" onClick="doQuery"
runat="server" />
<!-- HTML code to display the DataGrid on the screen selection is
determined from user
input selection from DropDownList -->
<asp:Datagrid
Id="MyDataGrid"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false">
</asp:DataGrid>
</td>
</tr>
</table></div>
</Form>

</body>
</html>
Nov 18 '05 #1
6 1725
....and the error is? And the line of code it points to is?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Teep" <ti********@nav-international.com> wrote in message
news:e5**************************@posting.google.c om...
Below is my code for dropdownlist that is populated from a SQL table.
After a selection from the ddl, a datagrid is suppose to come up
pertaining to the information selected, but I keep getting a DNS
error. I developed this "simple" page but so far it is not simple!
argh!

<%@ Page Language="VB" Debug="true" Explicit="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SQLClient" %>
<script runat="server">

Dim strConn as string =
"server=abcdserver;database=acct_payable;trusted_c onnection=true"

Sub Page_Load(Source as Object, E as EventArgs)
if not Page.IsPostBack then
doData()
end if
End Sub


Sub doQuery(Source as Object, E as EventArgs)
'Sub doQuery is for the datagrid
'This may be the source of DSN errors - the sql statement
Dim supname as string
Dim MySQL = "SELECT splr_name, splr_name, splr_addr, " & _
"splr_city FROM tbl_ap_vendors WHERE splr_name='" & supname &
"'"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"tbl_ap_vendors")

'MyDataGrid is for the datagrid to fill
MyDataGrid.Datasource=ds.Tables("tbl_ap_vendors"). DefaultView
MyDataGrid.DataBind()
End Sub
Sub doData()
'Sub doData is for the dropdownlist
Dim strSQL =
"server=abcdserver;database=acct_payable;trusted_c onnection=true"

Dim Conn as new SQLconnection(strConn)
strSQL = "select splr_name from tbl_ap_vendors ORDER BY
splr_name"
Dim Cmd as New SQLCommand(strSQL,Conn)
Conn.Open()
MyDropDownList.DataSource = Cmd.ExecuteReader()
MyDropDownList.DataBind()
End Sub
Function FixDR (sItem) as String
'Function FixDR is for null fields
if Not sItem is System.DBNull.Value then FixDR=sItem
End Function

</script>
<html>
<head>

<title>Testing a dropdownlist and datagrid</title>
</head>
<body>
<Form id="form1" runat="server">
<div align="center"><table> <tr>

</tr>
<tr>
<!-- HTML code to display the DropDownList on the screen for user
input
list is populated by a SQL table and selection bring up DataGrid -->
<td align="center" valign="Top" Colspan="2"><hr>
<b><i><font Color="#0000FF">Using a DropDownList and a
DataGrid:</font></i></b>
<asp:DropDownList id="MyDropDownList" datatextfield="splr_name"
runat="server" />
<asp:Button id="button" Text="Select Supplier Name" onClick="doQuery"
runat="server" />
<!-- HTML code to display the DataGrid on the screen selection is
determined from user
input selection from DropDownList -->
<asp:Datagrid
Id="MyDataGrid"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false">
</asp:DataGrid>
</td>
</tr>
</table></div>
</Form>

</body>
</html>

Nov 18 '05 #2
Thanks for looking at my post.

The SubdoQuery may be the source of the error - I posted that in my
code. The program runs the first half the ddl, and after the button is
clicked a generic DNS error page comes up - "the page cannot be
displayed."

Actually, on the bottom of the page it says: "Cannot find server or DNS
Error." No other error code, like 400s or 500s.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
That error code indicates that the web server specified in your URL does not
exist (for example, if you mis-typed "http://microsoft.com" as
"http://micorsoft.com", or that a DNS error has occurred which prevents the
browser from being able to resolve the IP address of the server. What does
the URL for the page look like in the address bar of your browser?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"TN Bella" <ti********@nav-international.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
Thanks for looking at my post.

The SubdoQuery may be the source of the error - I posted that in my
code. The program runs the first half the ddl, and after the button is
clicked a generic DNS error page comes up - "the page cannot be
displayed."

Actually, on the bottom of the page it says: "Cannot find server or DNS
Error." No other error code, like 400s or 500s.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4
Thanks for your help!
It says the same thing when the page loads and after the button is
clicked: http://localhost:8080/testingpage4.aspx
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5
Does your machine have a hosts entry for "localhost?" Try manually typing in
the URL in your browser, and substitute the machine name (or 127.0.0.1) for
"localhost" and see if you get the same error. What development environment
are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"TN Bella" <ti********@nav-international.com> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
Thanks for your help!
It says the same thing when the page loads and after the button is
clicked: http://localhost:8080/testingpage4.aspx
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #6


Thanks for your help. My error is now fixed, I just retyped the code
again and boom it worked! I appreciate all your time and patience with
this situation.

Tina

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason | last post by:
hello, i am new to PHP, so go easy. I am using the examples in the book: PHP: Your Visual Blueprint For Creating Open Source, Server Side Content In the section where they talk about...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
0
by: Tim::.. | last post by:
I keep getting the following error on a dropdownlist control I have added to a datagrid! I have given the control the correct id and don't get any errors when conpiling the code but as soon as I try...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
19
by: sasan3 | last post by:
Every thread I start goes out on a tangent simply because some of you people are not reading my posts carefully: Here is the phrase I am proposing for inclusion in the FAQ: "to existing...
8
by: illuzion | last post by:
ok I keep getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/illuzion/public_html/BAMF/contactus.php on line 38 and this error is possibly on other lines could...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.