Click here to Skip to main content
15,918,243 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: SMTP Setting for sending emails Pin
Not Active9-Aug-06 8:47
mentorNot Active9-Aug-06 8:47 
GeneralRe: SMTP Setting for sending emails Pin
Software_Guy_12310-Aug-06 6:28
Software_Guy_12310-Aug-06 6:28 
AnswerRe: SMTP Setting for sending emails Pin
RaghuSanta21-Aug-06 22:25
RaghuSanta21-Aug-06 22:25 
QuestionPhoto's in Database Pin
Mad M0nk9-Aug-06 6:09
Mad M0nk9-Aug-06 6:09 
AnswerRe: Photo's in Database Pin
Brent Lamborn9-Aug-06 9:05
Brent Lamborn9-Aug-06 9:05 
QuestionASP.NET DataGrid Parameter [modified] Pin
Soot9-Aug-06 5:11
Soot9-Aug-06 5:11 
AnswerRe: ASP.NET DataGrid Parameter Pin
leckey9-Aug-06 7:52
leckey9-Aug-06 7:52 
GeneralRe: ASP.NET DataGrid Parameter [modified] Pin
Soot9-Aug-06 8:01
Soot9-Aug-06 8:01 
VB.

Basically I need the program to do this, very simply a database call with a parameter.

1.User Form, user enters a string (user.form.string)

2.Call to database

3.Insert user.form.string into SELECT statement of ASP Datagrid


IE. Records have 2 items, IDENT tables, IDENT 1 = Georgia, IDENT 2 = Ohio

1.User enters an IDENT of 2

2. Datagrid displays with that IDENT of 1 in the SELECT statement

3. Display of Ohio information


The code should look something like this example from http://www.campus.ncl.ac.uk/databases/dotnet/[^]:

<%@ Page Language="vb" Debug="true" %><br />
<%@ import Namespace="System.Data" %><br />
<%@ import Namespace="System.Data.OleDb" %><br />
<script runat="server"><br />
<br />
    'Global scope variable<br />
       Dim ResultCount As Integer<br />
    <br />
      Sub GetText(sender As Object, e As EventArgs)<br />
    <br />
         Dim dslath As DataSet<br />
         Dim conLath As OleDbConnection<br />
         Dim cmdLath As OleDbDataAdapter<br />
         Dim Selectcommand As String = "select idno,year,text from latham " & _<br />
                                 "where text like '%" + selection.value + "%'"<br />
         Dim RcdCount As Integer<br />
    <br />
    <br />
         conLath = New OleDbConnection( _<br />
                       "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
                           "Data Source=\\tower1\home01\nlms1\datab2000\latham.mdb")<br />
    <br />
         cmdLath = New OleDbDataAdapter(selectcommand,conlath)<br />
    <br />
          dsLath = New DataSet()<br />
          cmdLath.Fill(dsLath,"Txt")<br />
    <br />
    RcdCount = dsLath.Tables("Txt").Rows.Count.ToString()<br />
    ResultCount=RcdCount<br />
    RecordCount.Text="<font color=red>" & RcdCount & "</font> records found"<br />
    <br />
          GridLath.DataSource = dsLath.Tables("Txt").DefaultView<br />
          GridLath.DataBind<br />
    <br />
       End Sub<br />
<br />
</script><br />
<html><br />
<head><br />
    <title>Searching  - uses Latham</title><br />
</head><br />
<body text="#000000" bgcolor="#ffffff"><br />
    <h2 font="Verdana">Listing from Latham Accounts using dot net - with a search and a count of the records found. <br />
    </h1><br />
<form runat="server"><br />
<P>Enter a word or part of a word</P><br />
<br />
 <P><INPUT TYPE=text ID=selection VALUE="Enter a word" SIZE=30 runat="server"></P><br />
 <br />
<P><INPUT TYPE=submit OnServerClick="GetText" VALUE="Start the search" runat="server"></P><br />
<br />
    <p></p><br />
<asp:label id="RecordCount" runat="Server"/><br />
<P></P><br />
<HR><br />
<P></P><br />
<asp:DataGrid id="GridLath" <br />
    Font-Name="Verdana" <br />
    Font-Size="10pt" <br />
    BackColor="#CCCCCC" <br />
    Width="90%" <br />
    Border="0" <br />
    Cellpadding="5" <br />
    runat="server" <br />
    AutoGenerateColumns="False"<br />
    EnableViewState="false"><br />
<HeaderStyle font-bold="True" HorizontalAlign="Center"/><br />
<Columns><br />
    <asp:BoundColumn DataField="idno" HeaderText="Line number" /><br />
    <asp:BoundColumn DataField="year" HeaderText="Year" /><br />
    <asp:BoundColumn DataField="text" HeaderText="Text of the account" /><br />
</Columns><br />
</asp:DataGrid><br />
</form><br />
<hr><br />
Lorna.Scammell@ncl.ac.uk - August 2002<br />
</body>


:




-- modified at 14:25 Wednesday 9th August, 2006

GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active9-Aug-06 9:05
mentorNot Active9-Aug-06 9:05 
GeneralRe: ASP.NET DataGrid Parameter Pin
Soot9-Aug-06 9:37
Soot9-Aug-06 9:37 
GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active9-Aug-06 10:13
mentorNot Active9-Aug-06 10:13 
GeneralRe: ASP.NET DataGrid Parameter Pin
Soot9-Aug-06 10:27
Soot9-Aug-06 10:27 
GeneralRe: ASP.NET DataGrid Parameter [modified] Pin
Soot9-Aug-06 10:30
Soot9-Aug-06 10:30 
GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active9-Aug-06 13:02
mentorNot Active9-Aug-06 13:02 
GeneralRe: ASP.NET DataGrid Parameter Pin
Soot10-Aug-06 2:33
Soot10-Aug-06 2:33 
GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active10-Aug-06 5:13
mentorNot Active10-Aug-06 5:13 
GeneralRe: ASP.NET DataGrid Parameter [modified] Pin
Soot10-Aug-06 5:28
Soot10-Aug-06 5:28 
GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active10-Aug-06 5:54
mentorNot Active10-Aug-06 5:54 
GeneralRe: ASP.NET DataGrid Parameter Pin
Soot10-Aug-06 6:18
Soot10-Aug-06 6:18 
GeneralRe: ASP.NET DataGrid Parameter Pin
Not Active10-Aug-06 7:26
mentorNot Active10-Aug-06 7:26 
QuestionNeed the Help for Intergartion for EPDQ Pin
Syed Taqi9-Aug-06 3:56
Syed Taqi9-Aug-06 3:56 
AnswerRe: Need the Help for Intergartion for EPDQ Pin
enjoycrack9-Aug-06 17:04
enjoycrack9-Aug-06 17:04 
GeneralRe: Need the Help for Intergartion for EPDQ Pin
Syed Taqi10-Aug-06 1:31
Syed Taqi10-Aug-06 1:31 
GeneralRe: Need the Help for Intergartion for EPDQ Pin
enjoycrack10-Aug-06 4:57
enjoycrack10-Aug-06 4:57 
Questionviewstate and atlas Pin
Masood Ahmed9-Aug-06 3:36
Masood Ahmed9-Aug-06 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.