Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Re: Connectivity Problem of Sql Server2000 and ASP/ASP.NET

Re: Connectivity Problem of Sql Server2000 and ASP/ASP.NET

Scheduled Pinned Locked Moved ASP.NET
asp-netsecurityhelpcsharpdatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rihdus
    wrote on last edited by
    #1

    Dear friends , I m in trouble by this problem: I have to read records from table ethnicity(with two cols)from sql server2000. my asp.net code is given below. ============================================================================= <%@ Page Language="vb" %> <%@ Import Namespace="System.data" %> <%@ Import Namespace="System.data.Oledb" %> sub Page_load(obj as object, e as eventargs) dim connection1 as new oledbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Scineceoflife;Data Source=amit-5;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=AMIT-5;Use Encryption for Data=False;Tag with column collation when possible=False") dim objcmd as new OleDbDataAdapter("select * from Ethnicity", connection1) dim ds as DataSet=new DataSet() objcmd.Fill(ds, "ethnicity") dim dt as datatable=ds.Tables("ethnicity") Dim CurrRows() as DataRow=dt.select(Nothing,nothing, DataViewRowState.CurrentRows) Dim I,J as Integer Dim Stroutput as String For I=0 to CurrRows.Length-1 For j=0 to dt.columns.count-1 stroutput=stroutput & dt.columns(j).Columnname & "="& _ CurrRows(I)(J).ToString & "<BR>" next next Response.write(stroutput) end sub ============================================================================== after building it i find following message: ============================================================================= <big>Login failed for user 'AMIT-5\ASPNET'. </big> Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'AMIT-5\ASPNET'. Source Error: Line 9: Line 10: dim ds as DataSet=new DataSet() <b>Line 11: objcmd.Fill(ds, "ethnicity")</b> Line 12: dim dt as datatable=ds.Tables("ethnicity") Line 13: Dim CurrRows() as DataRow=dt.select(Nothing,nothing, DataViewRowState.CurrentRows) Source File: d:\inetpub\wwwroot\scienceoflife\WebForm6.aspx Line: 11 Stack Trace: ============================================================================== amit-5 is my computer name, login id is 'Administrator', passwd is blank plz consider it ! With regards :mad: </x-turndown>

    B 1 Reply Last reply
    0
    • R rihdus

      Dear friends , I m in trouble by this problem: I have to read records from table ethnicity(with two cols)from sql server2000. my asp.net code is given below. ============================================================================= <%@ Page Language="vb" %> <%@ Import Namespace="System.data" %> <%@ Import Namespace="System.data.Oledb" %> sub Page_load(obj as object, e as eventargs) dim connection1 as new oledbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Scineceoflife;Data Source=amit-5;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=AMIT-5;Use Encryption for Data=False;Tag with column collation when possible=False") dim objcmd as new OleDbDataAdapter("select * from Ethnicity", connection1) dim ds as DataSet=new DataSet() objcmd.Fill(ds, "ethnicity") dim dt as datatable=ds.Tables("ethnicity") Dim CurrRows() as DataRow=dt.select(Nothing,nothing, DataViewRowState.CurrentRows) Dim I,J as Integer Dim Stroutput as String For I=0 to CurrRows.Length-1 For j=0 to dt.columns.count-1 stroutput=stroutput & dt.columns(j).Columnname & "="& _ CurrRows(I)(J).ToString & "<BR>" next next Response.write(stroutput) end sub ============================================================================== after building it i find following message: ============================================================================= <big>Login failed for user 'AMIT-5\ASPNET'. </big> Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'AMIT-5\ASPNET'. Source Error: Line 9: Line 10: dim ds as DataSet=new DataSet() <b>Line 11: objcmd.Fill(ds, "ethnicity")</b> Line 12: dim dt as datatable=ds.Tables("ethnicity") Line 13: Dim CurrRows() as DataRow=dt.select(Nothing,nothing, DataViewRowState.CurrentRows) Source File: d:\inetpub\wwwroot\scienceoflife\WebForm6.aspx Line: 11 Stack Trace: ============================================================================== amit-5 is my computer name, login id is 'Administrator', passwd is blank plz consider it ! With regards :mad: </x-turndown>

      B Offline
      B Offline
      Bee Master
      wrote on last edited by
      #2

      Create login for AMIT-5\ASPNET in SQL server. //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups