No error message available, result code...

No error message available, result code...
2008-08-29T13:23:49+02:00
2008-09-10T16:24:07+02:00
2022-11-10T21:55:41+01:00
Mogyi22
Sziasztok!


Van egy oldalam, ahol a controllok értékét szeretném felvenni egy táblába.
Ehhez a következő clickactiont használom:


Dim MySQL As String = "INSERT INTO problem (aid, problem, description, dadvice, dteamid) VALUES (" & DropDownList1.SelectedValue & "," & TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text & "," & DropDownList2.SelectedValue & ")" Dim MyConn As New OleDbConnection("Provider=SQLOLEDB;Data Source=(local)\SQLEXPRESS;AttachDbFilename=|DataDirectory|\datas.mdf;Integrated Security=True;User Instance=True") Dim cmd As New OleDbCommand(MySQL, MyConn) MyConn.Open() cmd.ExecuteNonQuery() MyConn.Close()

Az így kapott hibaüzenet:

Server Error in '/techhelp' Application.
--------------------------------------------------------------------------------

No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21).
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: No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21).

Source Error:


Line 10: Dim MyConn As New OleDbConnection("Provider=SQLOLEDB;Data Source=(local)\SQLEXPRESS;AttachDbFilename=|DataDirectory|\datas.mdf;Integrated Security=True;User Instance=True")
Line 11: Dim cmd As New OleDbCommand(MySQL, MyConn)
Line 12: MyConn.Open()
Line 13: cmd.ExecuteNonQuery()
Line 14: MyConn.Close()


Source File: C:\Documents and Settings\laszlo.fabian\Desktop\techhelp\dataload.aspx.vb Line: 12

Stack Trace:


[OleDbException (0x80040e21): No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21).]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1131233
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
dataload.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\laszlo.fabian\Desktop\techhelp\dataload.aspx.vb:12
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


Nincs valami ötlet, hogy hol lehet a hiba? Nem vagyok túl jártas a progrmaozásban, így gyanítom, hogy a connetionstringet írtam el...
Neten kerestem pár helyen, de nem találtam megoldást rá.

A mostani connectionstringet egy sqldatasource-ból másoltam. Lehet, hogy ezzel van a gond?

Köszi, M
Mutasd a teljes hozzászólást!
Dim MyConn As New OleDbConnection("Provider=SQLOLEDB;Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=|DataDirectory|datas.mdf; Trusted_Connection=Yes;")

datas.mdf + SQLExpress akkor miért

OleDbConnection + Provider=SQLOLEDB

én ilyen összeállítást nem találtam az általad jelzett oldalon.
de ilyent igen:

Attach a database file on connect to a local SQL Server Express instance Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

vagy kukkants ide..(connectionStrings Element (ASP.NET Settings Schema))
Mutasd a teljes hozzászólást!

Tetszett amit olvastál? Szeretnél a jövőben is értesülni a hasonló érdekességekről?
abcd