Quantcast
Channel: Access Databases and AccessDataSource Control
Viewing all 518 articles
Browse latest View live

Login failed for user IIS APPPOOL\DefaultAppPool

$
0
0

I am working on web application. Suddenly i got the error  "System.Data.SqlClient.SqlException was unhandled by user code:  Login failed for user 'IIS APPPOOL\DefaultAppPool".

StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
       at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
       at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
       at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
       at System.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters)
       at TP.Test.Model.RepositoryEntities.ThePaymentGroupDataContext.GetPageContentsByPageName(String pageName) in C:\Anjan\test.designer.cs:line 632
       at TP.Test.Model.Repositories.CMSRepository.GetPageContentsByPageName(String pageName) in C:\Anjan\test.cs:line 26
       at TP.Test.Model.BLL.CMSService.GetPageContentsByPageName(String pageName) in C:\Anjan\test.cs:line 37
       at TP.PaymentGroup.Web.UI.Admin.Default.Page_Load(Object sender, EventArgs e) in C:\Anjan\Default.aspx.cs:line 31
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:


Can anybody to face such type of problem. 


Transactionscope use for multiple methods

$
0
0

I have one method in a single transactionscope. Code inside the transactionscope call a sp and there are 3 tables used in the sp.  on the basis of two tables sp insert data in 3rd table.

but the transactionscope blocks all the 3 tables used in the sp inside transactionscope untill the code commit transactionscope.

Please help in ORACLE SP and .NET Code to call the SP

$
0
0

Hi Friends,

Please help me. This is my stored procedure

create or replace
PROCEDURE GET_SELECT1
(
p_recordset1 OUT Types.cursor_type) AS

BEGIN
OPEN p_recordset1 FOR
SELECT * FROM TBL_SAMPLE WHERE Value= '72' and ceil(rownum/10)=1 ;

END;

How do i call this Stored procedure in C# code

WIth out any oracle parameter i'm calling this SP. is this correct?

dt = Orahelp.ExecuteNonQuery_SP("GET_SELECT1");
return dt;

Please do help me in fixing this issue.... 

DateAdd weeks calculation

$
0
0

Hi,

I believe I do have the syntax correct, but as we represent the weeks in a "strange" format this maybe the cause for the results not been correct. We represent the weeks as yyyyww (201249; 201250; 201251; 201252; 201301; 201302; etc) and I woudl like for the query to give me the last 13 weeks of data so in my condition I wrote:

[code]

WHERE ((BI.Week) Between DateAdd("w",-13,[Current_Week]) And DateAdd("w",-1,[Current_Week]))

[/code]

if current week is "201310" then I would expect to see data from week 201249, however this is not the case as it gives me data from week 201301 until week 201309...

Am I doing anything wrong? is there any solution for the query to recognize the turn of the year?

Any help is very much appreciated.

Re: Transactionscope use for multiple methods

$
0
0

hi  bisht.mahe,

From what I understand you want to  use Transactionscope  for multiple methods. 

I would suggest you to try the following workaround:

TransactionScope Class

http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

TransactionScope: transaction escalation behavior

http://pieterderycke.wordpress.com/2012/01/22/transactionscope-transaction-escalation-behavior/

Using TransactionScope to share transactions between Methods

http://social.msdn.microsoft.com/Forums/en-US/60b947bf-96aa-4889-bd43-3cea86786444/using-transactionscope-to-share-transactions-between-methods

If you need more assistance, please let me know.

Help Creating Database Relationship Entity Diagram

$
0
0

Hey everyone, i am currently trying to develope a database for my PC support website. I am unsure of where exactly entities go in the four tables i believe are required to make. 

The entities consist of 

  • Record Number
  • Time/Date
  • Problem Record Details
  • Problem Type
  • Problem Description
  • Problem Resolution
  • Problem Status
  • Client Name
  • Client Phone Number
  • Client Email
  • Technician Name
  • Technician Email Address
  • Date Completed

I believe the four tables should be of client, technician, problem and record. But i dont quite understand what to put in each table and the foreign keys required in each to work.

Thanks Alot

Transactionscope use for multiple methods

$
0
0

I have one method in a single transactionscope. Code inside the transactionscope call a sp and there are 3 tables used in the sp.  on the basis of two tables sp insert data in 3rd table.

but the transactionscope blocks all the 3 tables used in the sp inside transactionscope untill the code commit transactionscope.

Re: DateAdd weeks calculation

$
0
0

Many thanks Hans,

And that was me thinking that I knew Access, great SQL and I will cherish them to use when necessary.

Again Many thanks for the help.


DateAdd weeks calculation

$
0
0

Hi,

I believe I do have the syntax correct, but as we represent the weeks in a "strange" format this maybe the cause for the results not been correct. We represent the weeks as yyyyww (201249; 201250; 201251; 201252; 201301; 201302; etc) and I woudl like for the query to give me the last 13 weeks of data so in my condition I wrote:

[code]

WHERE ((BI.Week) Between DateAdd("w",-13,[Current_Week]) And DateAdd("w",-1,[Current_Week]))

[/code]

if current week is "201310" then I would expect to see data from week 201249, however this is not the case as it gives me data from week 201301 until week 201309...

Am I doing anything wrong? is there any solution for the query to recognize the turn of the year?

Any help is very much appreciated.

Dynamic SQL in access like sp_executesql?

$
0
0

Hi there.

How to have dynamic sql in access db like sp_executesql?

How to read Access database tables list and structures?

$
0
0

Hi there.

Is it possible to read the list of tables and their structures in an access db?

Possible to create stored procedures in Access by code?

$
0
0

Hi there.

I know in Access 2010 we can have named macros.

I want to know if it's possoble to create them with a code like this:

CREATE PROC Test

@ID int

AS

...

32 bit odbc on windows 8 and microsoft access 2010

$
0
0

Hello,

I found a tutorial of what I need to do to make a dnc connection using 32bit odbc on my windows 8 64 bit machine .

I select Systemt DNS tab and then hit add.  I have no choice for microsoft access.  The only choices I have are sql server and sql client.  There is no choice of choosing microsoft access driver.  What could be wrong? The defualt tab shows the driver as my image shows.  Why does the title of this odbc interface show the number 64? 

Would have something to do with installing the microsoft access software in 32 bit system?  I don't think so?  Is their some microsoft software that I need to enable 32 bit use? I hope I have explain enough. Help!

peoj

Write to Access Database from ASP.net

$
0
0

I am new to ASP.net but have some programming experience in VB.net with Visual Studio 2010.  What i am trying to do is load 5 fields into an access table when the user clicks a button.  We want to create a Web Application that we can put on our intranet so any user can open up and enter a Maintenance Request.  I have searched numerous different websites and found a way to get the page to load but when I click the Button, the screen flickers like something happened but I have no idea where or even if I have the connection set correctly.

My VB.net programming experience does not include setting up a connection string.

So with that being said, here is where I am at:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim concoaxis As SqlConnection
        Dim strInsert As String
        Dim cmdInsert As SqlCommand
        Dim dtmDate As DateTime


        dtmDate = DateTime.Now()


        concoaxis = New SqlConnection("Data Source=\\hiwts03\Files\Functional-Maintenance\01_Overall Equipment Effectiveness (OEE);Database=BMS_7.5.1.4_PreventiveMaintenance1.mdb")
        'concoaxis = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("BMS_7.5.1.4_PreventiveMaintenance1ConnectionString").ConnectionString)
        strInsert = "INSERT INTO List (RequestorName) Values (@Requestor)"

        cmdInsert = New SqlCommand(strInsert, concoaxis)

        cmdInsert.Parameters.AddWithValue("@Requestor", TextBox3.Text)
        Response.Write(TextBox3.Text)
        Try
            concoaxis.Open()
            cmdInsert.ExecuteNonQuery()
            concoaxis.Close()
            Response.Write("Updated Successfully!<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>")
        Catch
            concoaxis.Close()
        End Try

    End Sub


Currently my code is only trying to Insert one field and once I figured it out I was going to add the remaining 4. 

Any suggestions or directions?

Thanks is Advance

Help in saving data from another webform based on the data from previous webform

$
0
0

Hello, I really require help and suggestions. This is for my final year project. I have an activity that gathers data.

The first form is where the user enters data such as : username, age and gender. hence there is 3 columns with the same name as the data. After successfully entering this data, they are directed to the second form.

The second form is where the user is ask to do an activity and the data is stored. ex. Time taken.

I have successfully stored data for the first form, but I am unsure on how to continue storing the data from the next webform  in the same row as the previous data.

Ideas come to mind, like creating another table to store data and use one data as key to identify each user. But how do I keep track of the key, ex. username in order to know that this data belong to this user?

Any suggestions, insights and advice, are much appreciated. Thank you.


how to change caption column structure in Ms acess db..........caption is column in Ms acess db

$
0
0

HI masters, i have an website whose caption is coming from Ms acess db. structure is like this

letter receipt

new letter receipt

letter dispatch

i want this structure

1>letter receipt ----a>new letter receipt

                                b> dispatch

how to do  it . plz see screen shot and suggest

Datatype mismatch using date

$
0
0

Using ASP.NET (C#) I insert a record into an Access db table.  I need to be able to retrieve records by two parameters not only the cusID but also the time & date the record was created.  Here is what I have so far...

Insert a record... This works fine and inputs the date in MS Access table date format: General Date '10/9/2013 7:21:27 PM'

DateTime date = DateTime.Now;"INSERT INTO tblOrders ( CustomerID, OrderDate,...."VALUES (" + cusID + ", '" + date + "', '"

However, when I try to retrieve a record using the following WHERE clause I get a datatype mismatch error

"WHERE (((CustomerID)=" + cusID + ") AND ((OrderDate)='" + date.ToString() + "'));"

I know that its the date part that is throwing the error, I'm just not sure how to fix it.  I've tried droping the single quotes as well as not converting the date to a string.  What am I missing for this to execute correctly?



Unable to update data into Database

$
0
0

Hai, this is my code to update a specific column based on the unique ID. but I am unable to update the database. I am unsure whether there is anything wrong with my code:

protected void Button1_Click(object sender, EventArgs e)
    {
        string SqlString = "UPDATE Table1 SET Sentence = @sentence WHERE UniqueID = @ID";

        using (objCon = new OleDbConnection(ConnectString))
        {
            using (objCmd = new OleDbCommand(SqlString, objCon))
            {
                objCmd.Parameters.AddWithValue("@ID", userID);
                objCmd.Parameters.AddWithValue("@sentence", sentence.Text);
                objCon.Open();
                objCmd.ExecuteNonQuery();
            }
        }
    }



Entity frame work code first- saving image in database

$
0
0

hi, 

i m working in asp.met mvc4,

using Entity frame work Model first approach,

i want to save images/ pics in database, what should be the image data type save it in database???

how to access database through stored procedure

$
0
0

i want to display database result of "userid" using stored procedure.i have done the following

// THIS CODE IS UNDER "NI_AD_USER_MST2.CS(BLAYER)"

using System;
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace NIPL.TASK
{
    class NI_AD_USER_MST
    {
        SqlConnection con;
        DBFunctions HTMLREPORTS;
        SqlDataAdapter da;
        public void HTMLREPORT()
        {
            HTMLREPORTS = new DBFunctions();
        }
        public bool NI_AD_USER_MST(int userid, out DataSet ds)
        {


            con = HTMLREPORTS.GetConnection();
            da = new SqlDataAdapter("[nipl].[USER_MST_SP]", con);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@NI_ADUM_USER_ID", userid);
            DataSet dsout = new DataSet();

            da.Fill(dsout, "[nipl].[USER_MST_SP]");
            ds = dsout;
            con = HTMLREPORTS.CloseConnection();

            return true;
        }
    }
}

// THIS CODE IS UNDER NI_AD_HTML_REPORTS.ASPX.CS

using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Net;
using NIPL.TASK;

namespace NIPL.NIPL.TASK
{
   
    public partial class NI_AD_HTML_REPORTS : System.Web.UI.Page
    {

        NI_AD_USER_MST hr = new NI_AD_USER_MST();
        
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["EMPLOYEEConnectionString"].ToString());
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    con.Open();
                    string NI_QUERY = "";
                    string NI_USER_ID = Request.QueryString["UserId"];
                    string NI_Entity_ID = Request.QueryString["EntityId"];
                    string NI_ENTITY_ID = Session[NI_SessionClass.NI_SS_ENTITYID].ToString();
                    SqlCommand cmd;
                    SqlDataReader ad;
                    //Response.Write("</br>");
                    //Response.Write("</br>");
                    //Response.Write("</br>");
                    //Response.Write("</br>");
                    //Response.Write("</br>");
                    Response.Write("<TABLE border=1 cellspacing='0' cellpadding='0' width='100%'>");
                    Response.Write(" <th> User Name</th>");
                    Response.Write("<th> Email Id </th>");
                    Response.Write("<th> User Pan </th>");
                    Response.Write("<th> User Dept Id </th>");
                    Response.Write("<th> Dept Name </th>");
                    Response.Write("<th> Registration Date </th>");
                    Response.Write("<tr valign='top'>");
                    DataSet ds = new DataSet();
                    hr.NI_AD_USER_MST(NI_USER_ID, out ds);
                    cmd = new SqlCommand(NI_QUERY,con);
                    ad = cmd.ExecuteReader();
                    while (ad.Read())
                    {
                        Response.Write("<tr>");
                        Response.Write("<td width=\"15%\" align=\"left\">" + ad.GetValue(0).ToString() + "</td>");
                        Response.Write("<td width=\"15%\" align=\"left\">" + ad.GetValue(1).ToString() + "</td>");
                        Response.Write("<td width=\"15%\" align=\"left\">" + ad.GetValue(2).ToString() + "</td>");
                        Response.Write("<td width=\"10%\" align=\"left\">" + ad.GetValue(3).ToString() + "</td>");
                        Response.Write("<td width=\"20%\" align=\"left\">" + ad.GetValue(4).ToString() + "</td>");
                        Response.Write("<td width=\"25%\" align=\"left\" >" + ad.GetValue(5).ToString() + "</td>");
                        Response.Write("</tr>");



                    }
                    ad.Close();
                }
                catch (Exception eNI)
                {
                    Response.Write(eNI.Message);
                }
                finally
                {
                    con.Close();
                }
            }
        }
    }
}

//THIS IS MY STORED PROCEDURE

USE [EMPLOYEE]
GO

/****** Object:  StoredProcedure [nipl].[USER_MST_SP]    Script Date: 01/01/2013 17:36:13 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [nipl].[USER_MST_SP](
@NI_ADUM_USER_ID INT)
AS
BEGIN
SELECT * FROM nipl.NI_AD_USER_MST WHERE NI_ADUM_USER_ID = @NI_ADUM_USER_ID
END

GO

Viewing all 518 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>