Hi,
Yes it has been a great discussion. I have been learning a lot.
As I told you I am new to ASP.NET and at last post I got completely
lost.
Please focus on the problem I have in hands.
It's just that receiving all kind of general ideas is great because I
can learn but after a while I get lost and I try all kind of things but
I never get this right and working.
Here is my entire code. Maybe it's easier to get a view of it.
<%@ Page Language="VB" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral"
%>
<MM
ataSet
id="dsDocuments"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_conBonsAlunos")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conBonsAlunos")
%>'
CommandText='<%#
System.Configuration.ConfigurationSettings.AppSettings("queryDocuments")
%>'
Debug="true"
</MM
ataSet>
<MM
ageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import NameSpace="System.Text" %>
<script runat="server">
Sub Page_Load(sender As Object, e As System.EventArgs)
Response.Write(System.Configuration.ConfigurationSettings.AppSettings("queryDocuments"))
Dim queryDocuments As String =
System.Configuration.ConfigurationSettings.AppSettings("queryDocuments")
If Request.QueryString("pesquisar") Is Nothing Then
queryDocuments = "SELECT * FROM dbo.documents"
Else
queryDocuments = ""
Dim keywords as string()
keywords = Request.QueryString("pesquisar").Split(CChar(" "))
Dim i As Int32
For i = 0 To keywords.Length
queryDocuments += String.Format("CONTAINS (*, '{0}') ",
keywords(i))
If i + 1 = keywords.Length Then
i = keywords.Length
Exit For
End If
queryDocuments += " AND "
Next
queryDocuments = String.Format("SELECT * FROM dbo.documents WHERE
") & queryDocuments
End If
End Sub
Sub searchDocuments(sender As Object, e As System.EventArgs)
Server.Transfer("material-didactico.aspx?pesquisar=" &
Request.Form("pesquisar_keywords"))
End Sub
</script>
<html xmlns="
http://www.w3.org/1999/xhtml">
..
..
..
WEB.CONFIG:
<appSettings>
<add key="MM_CONNECTION_HANDLER_conBonsAlunos" value="sqlserver.htm"
/>
<add key="MM_CONNECTION_STRING_conBonsAlunos" value="Persist Security
Info=False;Data Source=(local);Initial Catalog=dbBonsAlunos;User
ID=sa;Password=" />
<add key="MM_CONNECTION_DATABASETYPE_conBonsAlunos" value="SQLServer"
/>
<add key="MM_CONNECTION_SCHEMA_conBonsAlunos" value="" />
<add key="MM_CONNECTION_CATALOG_conBonsAlunos" value="" />
<add key="queryDocuments" value="SELECT * FROM dbo.documents"/>
</appSettings>
Thanks once again,
Miguel