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="Syst em.Data" %>
<%@ import Namespace="Syst em.Data.SQLClie nt" %>
<script runat="server">
Dim strConn as string =
"server=abcdser ver;database=ac ct_payable;trus ted_connection= true"
Sub Page_Load(Sourc e 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(s trConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter( MySQL,MyConn)
Cmd.Fill(ds,"tb l_ap_vendors")
'MyDataGrid is for the datagrid to fill
MyDataGrid.Data source=ds.Table s("tbl_ap_vendo rs").DefaultVie w
MyDataGrid.Data Bind()
End Sub
Sub doData()
'Sub doData is for the dropdownlist
Dim strSQL =
"server=abcdser ver;database=ac ct_payable;trus ted_connection= true"
Dim Conn as new SQLconnection(s trConn)
strSQL = "select splr_name from tbl_ap_vendors ORDER BY
splr_name"
Dim Cmd as New SQLCommand(strS QL,Conn)
Conn.Open()
MyDropDownList. DataSource = Cmd.ExecuteRead er()
MyDropDownList. DataBind()
End Sub
Function FixDR (sItem) as String
'Function FixDR is for null fields
if Not sItem is System.DBNull.V alue then FixDR=sItem
End Function
</script>
<html>
<head>
<title>Testin g 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:DropDownLi st id="MyDropDownL ist" datatextfield=" splr_name"
runat="server" />
<asp:Button id="button" Text="Select Supplier Name" onClick="doQuer y"
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="#ccc cff"
BorderColor="bl ack"
ShowFooter="fal se"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaa add"
EnableViewState ="false">
</asp:DataGrid>
</td>
</tr>
</table></div>
</Form>
</body>
</html> 6 1746
....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********@n av-international.c om> wrote in message
news:e5******** *************** ***@posting.goo gle.com... 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="Syst em.Data" %> <%@ import Namespace="Syst em.Data.SQLClie nt" %> <script runat="server">
Dim strConn as string = "server=abcdser ver;database=ac ct_payable;trus ted_connection= true"
Sub Page_Load(Sourc e 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(s trConn) Dim ds as DataSet=New DataSet() Dim Cmd as New SQLDataAdapter( MySQL,MyConn) Cmd.Fill(ds,"tb l_ap_vendors")
'MyDataGrid is for the datagrid to fill MyDataGrid.Data source=ds.Table s("tbl_ap_vendo rs").DefaultVie w MyDataGrid.Data Bind() End Sub
Sub doData() 'Sub doData is for the dropdownlist Dim strSQL = "server=abcdser ver;database=ac ct_payable;trus ted_connection= true"
Dim Conn as new SQLconnection(s trConn) strSQL = "select splr_name from tbl_ap_vendors ORDER BY splr_name" Dim Cmd as New SQLCommand(strS QL,Conn) Conn.Open() MyDropDownList. DataSource = Cmd.ExecuteRead er() MyDropDownList. DataBind() End Sub
Function FixDR (sItem) as String 'Function FixDR is for null fields if Not sItem is System.DBNull.V alue then FixDR=sItem End Function
</script> <html> <head>
<title>Testin g 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:DropDownLi st id="MyDropDownL ist" datatextfield=" splr_name" runat="server" /> <asp:Button id="button" Text="Select Supplier Name" onClick="doQuer y" 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="#ccc cff" BorderColor="bl ack" ShowFooter="fal se" CellPadding=3 CellSpacing="0" Font-Name="Verdana" Font-Size="8pt" HeaderStyle-BackColor="#aaa add" EnableViewState ="false"> </asp:DataGrid> </td> </tr> </table></div> </Form> </body> </html>
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!
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********@n av-international.c om> wrote in message
news:Od******** ******@tk2msftn gp13.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!
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********@n av-international.c om> wrote in message
news:uD******** ******@tk2msftn gp13.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!
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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 getting values from a form
submission, the book says:
|
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 the following error when attempting to create or
open the Web project located at the following URL:
'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
|
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 to access the page I receive the error show below!
Can someone please tell me why and how I might fix it!
Thanks!
ERROR: Object reference not set to an instance of an object.
...::INLINE CODE
|
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 parent table.
----------------------------
|
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 members of the group: please understand that for every
expert in a field, there are many new comers who will need direction
and help to get started. Please encourage new-comers by being tolerant
of all questions, even if not well-researched, or...
| |
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 someone please help me out with this it is for a contact form for a webpage that I am making for a class project but I decided to add in this contact form....
<?php
|
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 order, Input field and a submit button.
The Category name is being fetched from the oracle db along with the corresponding Category order.
In the corresponding input field (text box) the user enters a new category order which gets stored in...
|
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 of section c.
Not sure where went wrong as the web page displayed internal server error.
Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
|
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, commercially sold application with only partial build instructions. The previous maintainer of the code (a
mixture of C and C++) is no longer with the company, but when he built the code he used MSVC++, and though I am not certain of the version he was ...
|
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 assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in before determining if the employee has an actual "significant" hearing loss.
Anyway...I have my...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |