[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL S

RobertFanney

New Member
hi all <BR> I have got this problem while accessing the database. can anyone help me. thanks in advance and my code is as follows it is a web application in asp.net<BR><BR>sai gopal<BR><%@ Page Language="VB" Debug="True"%><BR><HTML><BR> <HEAD><BR><script runat="server"><BR><BR>Dim rs 'As ADODB.Recordset<BR>Dim sql As String<BR>Dim db 'As ADODB.Connection<BR>Dim con As String<BR>dim OFFSET<BR>dim DocumentSpec<BR>dim MaptoInternalId<BR>dim DocumentType<BR>dim s1<BR>dim s2<BR>dim s3<BR>dim inbountDocumentSpec<BR>dim outbountDocumentSpec<BR>dim MapID<BR>dim DocumentTypeID<BR>dim DocumentTypeInstanceID<BR>dim Map<BR></script><BR><!-- #include virtual = "/dotnet/adodb.inc" --><BR><%<BR>DocumentTypeID = Request.Form("h12")<BR>DocumentTypeInstanceID = Request.Form("h2")<BR>MapID = request.Form("h3")<BR>inbountDocumentSpec = Request.Form("inbountdocspec")<BR>outbountDocumentSpec = Request.Form("outbountdocspec")<BR>Map = Request.Form("MapName")<BR>if inbountDocumentSpec <> "" Then<BR><BR>sql = "EXEC SP_DocumentSpecification_Create " & DocumentTypeID & "," & MaptoInternalID & "," & MapID<BR>'Response.Write sql<BR><BR>db = Server.CreateObject("ADODB.Connection")<BR>db.Open(con)<BR>' rs = nothing<BR>rs = Server.CreateObject("ADODB.RecordSet")<BR><BR>'Response.Write sql<BR><BR>rs.Open( sql, db, 3, 3)<BR><BR>db.close<BR>End If<BR>%><BR></HEAD><BR><body vlink="#808080" alink="#808080" link="#ff0063" bgcolor="#ffffff" background="./logoe24.jpg"><BR><BR><BR><BR><BR><BR> <center><b> Inbount and Outbount Document Specification Page</b><BR><BR><BR> <p><BR> <FORM id="Form1" name="login" action="http://localhost/WebApplication1/Test081002.aspx" method="post" runat="server"><BR> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="280" border="0" height="185"><BR> <tr><BR> <td><BR> <asp:textbox id=h12 maxLength=50 runat="Server" Visible="false" Width="31"/><BR> <tr><BR> <td>Inbount Document Specification</td><BR> </tr><BR> <TR><BR> <TD><BR> <%<BR> <BR> rs=Server.CreateObject ("ADODB.RecordSet")<BR> s1=request.Form("h12")<BR> sql="Select DocumentTypeID,InternalDocSpec from DocumentType"<BR> rs.Open(sql,con)<BR> %><BR> <asp:DropDownList ID="inbountdocspec" Width="146" Runat="server"/><BR> <%<BR> if not rs.eof then<BR> rs.movefirst<BR> do while not rs.eof<BR> %><BR> <ASP:LISTITEM selected="True" value=http://aspmessageboard.com/archive/index.php/'<%=rs.fields("DocumentTypeID")%>'><BR> <%=rs.fields("InternalDocSpec")%><BR> </ASP:LISTITEM><BR> <%<BR> rs.movenext<BR> loop <BR> else<BR> %><BR> <%<BR> end if<BR> rs=nothing<BR> %><BR> </TD><BR> </TR><BR> <tr><BR> <td><BR> <asp:textbox id="h2" maxLength=50 runat="Server" Visible="false" Width="31"/><BR> </td><BR> <BR> <BR> <tr><BR> <td>Outbount Document Specification</td><BR> </tr><BR> </tr><BR> <TR><BR> <td><BR> <%<BR> rs=Server.CreateObject("ADODB.RecordSet")<BR> s2=request.Form("h2") <BR> sql="Select DocumentTypeInstanceID,DocSpec from DocumentTypeInstance"<BR> rs.open(sql,con)<BR> %><BR> <asp:DropDownList ID="outbountdocspec" Width="146" Runat="server"/><BR> <%<BR> if not rs.eof then<BR> rs.movefirst<BR> do while not rs.eof <BR> %><BR> <ASP:LISTITEM selected="True" value='<%=rs.fields("DocumentTypeInstanceID") %>'><BR> <%=rs.fields("DocSpec") %><BR> </ASP:LISTITEM><BR> <%<BR> rs.movenext<BR> loop<BR> else<BR> %><BR> <%<BR> end if<BR> rs=nothing<BR> %><BR> </td><BR> </TR><BR> <tr><BR> <td><BR> <asp:textbox id="h3" maxLength=50 runat="Server" Visible="false" Width="31"/> <BR> </td><BR><BR> <BR> <tr><BR> <td>Map</td><BR> </tr><BR> </tr><BR> <TR><BR> <td><BR> <%<BR> rs = Server.CreateObject("ADODB.RecordSet")<BR> s3=request.form("h3")<BR> sql="Select MapID, MapName from Map"<BR> rs.Open(sql,con)<BR> %><BR> <asp:DropDownList ID="MapName" Width="146" Runat="server"/><BR> <%<BR> if not rs.eof then<BR> rs.movefirst<BR> do while not rs.eof <BR> %><BR> <ASP:LISTITEM selected="True" value='<%=rs.fields("MapID") %>'><BR> <%=rs.fields("MapName") %><BR> </ASP:LISTITEM><BR> <%<BR> rs.movenext<BR> loop<BR> else <BR> %><BR> <%<BR> end if<BR> rs=nothing<BR> %><BR> </td><BR> </TR><BR> <tr><BR> <td align="right"><BR> <input type= submit id="Submit1" runat="server" ><BR> </td><BR> </tr><BR> </TABLE><BR> </FORM><BR> </p><BR> </center><BR></body><BR></HTML><BR>.NET code. Where on earth did you get it? <BR><BR>It's really just ASP code with some .NET'tish bits in it!<BR><BR>Rather than help you work through that code, my suggestion is that you go and buy a good book on how to code ASP .NET pages.<BR><BR>Also, have a look through the online tutorials:<BR><BR> http://www.asp.net/Tutorials/quickstart.aspxmy doubt is the database is not accessed to the above said file i have included a inclusive file which contains following info. where can i include that file instead of inc tag. the file is <BR><BR>adodb.inc<BR><%<BR>''''''''''''''''''''''''''''''''''<BR>OFFSET=850<BR>con = "PROVIDER=MSDASQL;"<BR>con = con & "DRIVER=SQL Server;"<BR>con = con & "SERVER=localhost;"<BR>con = con & "UID=sa;"<BR>con = con & "PWD=dbadmin;"<BR>con = con & "DATABASE=B2BBroker;"<BR>''''''''''''''''''''''''''''''''''<BR>%><BR>sai gopalThe ASP.NET architecture provides the Web.config file to store certain application data - such as connection strings!<BR><BR>Specifically, there is a special element in the Web.config file called <appSettings> which lets you store keyed values.<BR><BR>There's an article on 4Guys about it, I'd highly recommend that you search for it and give it a good read :)hi me again<BR> I am looking at those website u have given me i am sending u a link of the web site and i have some doubt in it. It matches my doubt. ok. plz go through this site and solve my doubt<BR><BR>http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/intro/Intro10.src<BR><BR>And my doubt starts from this code onwards <BR><BR>where server="(local)NetSDK. ......." ok <BR> <BR><BR>MyConnection = New SqlConnection("server=(local)NetSDK;database=pubs;Trusted_Connect ion=yes")<BR> MyCommand = New SqlDataAdapter("select * from Titles where type='" + Category.SelectedItem.Value + "'", myConnection)<BR><BR>as far my code is concerned i wrote the connection in another .inc file. <BR><BR>my .inc file is as follows<BR><BR><%<BR>''''''''''''''''''''''''''''''''''<BR>OFFSET=850<BR>con = "PROVIDER=MSDASQL;"<BR>con = con & "DRIVER=SQL Server;"<BR>con = con & "SERVER=w9f00038;"<BR>con = con & "UID=sa;"<BR>con = con & "PWD=dbadmin;"<BR>con = con & "DATABASE=pubs;"<BR>''''''''''''''''''''''''''''''''''<BR>%><BR> ok<BR> plz solve my problem where i have made mistake.<BR><BR>sai gopalWell, you are using an OLEDB connection string. The example is using a string configured for the .NET SQL managed provider. They're completely different.<BR>
 
Top