Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all 1350 articles
Browse latest View live

Convert Html file to Word file

$
0
0

Hi guys,

I need to convent Html file to Word(.doc) file using openXml with exact format and images.Any suggestion to achieve this.

Thanks in advance    


If cONDITION WITH For loop in c#.net

$
0
0

Here_dtt.Rows have the value code.If the datarow (named code) in the datatable (dtt) equal to the value of session, then only the Insertion inside the FOR loop must take place.But error is showing for -> if (dr28[CODE].ToString() == selectedadmin)

cmd28.Connection = conn;

cmd28.Transaction = trans;

cmd28.CommandText =OracleHelper.FixCommandText("INSERT INTO "+ _tblnpf +"DOC(ISCOM,CODE) VALUES (@iSCOM,@CODE) ");

cmd28.CommandType =CommandType.Text;

DbParameter param28 =null;

foreach (DataRow dr28 in _dtt.Rows)

{

string selectedadmin =HttpContext.Current.Session["site"].ToString();

 if (dr28[CODE].ToString() == selectedadmin)

{

cmd28.Parameters.Clear();

 OracleHelper.CreateParameter(ref cmd28,ref param28,"@ISCOM",DbType.String,ParameterDirection.Input, dr28["ISCOM"].ToString());

OracleHelper.CreateParameter(ref cmd28, ref param28,"@CODE",DbType.String,ParameterDirection.Input, dr28["CODE"].ToString());

cmd28.ExecuteNonQuery();

}

}

When executing on connection to Oracle "an INTO clause is expected in this SELECT statement"

$
0
0

I have an Oracle database that - when I connect to it and execute even the simplest "Select * from myTable" statement - returns:
"ORA-06550: line 1, column 7: PLS-00428: an INTO clause is expected in this SELECT statement"

Connection string is fine, connection is established and opened with no problems, only when for example calling executeReader on a OracleCommand object, I get the above error.

Any ideas?

J. Jespersen

where is my object explorer icon in oracle sql developer ?

$
0
0

 Hi,

somehow,my object explorer window was close.
Now I am unable to find any icon or link that would open this window.
Any help ?

 

Thanks

asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect identifier specified

$
0
0

 

 

I created webapp on one server to query an oracle database housed on another server

It works from within visual studio,”view in browser” but when the page is server from IIS the following is displayed

 

System.Data.OracleClient.OracleException:ORA-12154: TNS:could not resolve the connect identifier specified

 

Any help is much appreciated; [:'(]

full details of the setup are below, is this a permissions issue.

I have read many many posts and believe that I have everything configured correctly ?

 

 

SERVERone:

Windows 2003 server running IIS 6.0 with .NET framework 2.057 and oracle InstantClient.

Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

                       I have a tnsname.ora and sqlnet.ora saved to the same directory (C:\instantClient\instantclient10_1)

I have a corresponding enviroment variable to that folder TNS_ADMIN C:\instantClient\instantclient10_1

“Authenticated Users” has FULL CONTROL  permissions on this folder and subfolders

Permission for read execute are also set for IWAM_SERVERone , IUSR_SERVERone, SERVERtwo/ASPNET

 

 

SERVEtwo:

Windows 2003 sever which is running an instance of Oracle 9i database.in

ORA home folder“Authenticated Users” has FULL CONTROL permissions and sub folders

Permission for read execute are also set for IWAM_SERVERone, IUSR_SDMS-SERVERone, SERVERtwo ASPNET

 

I can successfully connect from SERVERone to SERVERtwo usingTOAD 9.0.1 and I can query the database.

 

More Details.....

I want to create a web app on SERVERone to queryan oracle database on SERVERtow

I created an ASP.NET application using visual web developer.

I addded a sqldatasource and configured the sqldatasource to use “oracle database” as the data source, and the data provider.NET Framework Data Provider for Oracle

I set theServer Name to the entry from the Tnanames.ora file an dentered the username and password

When I click TEST CONNECTION it works , I then added a select * from xyz query

 

WHEN I RUN THE PAGE FROM WITHIN VWD it works perfectly ( “view in browser”)

 

However when I add the site to IIS and launch the page I get the ORA-12154 error

 

TNSNAME.ORA entry

 

HOMER=

 (DESCRIPTION =

   (ADDRESS_LIST =

       (ADDRESS =

         (PROTOCOL = TCP)

         (HOST = 182.198.100.14)

         (PORT = 1521)

       )

   )

   (CONNECT_DATA =

      (SID = ERR)

      (GLOBAL_NAME = ERR.world)

   )

 )

 

sqlnet.ora ( this is the only line in this file , I also tried NTFS to no avail)

 

SQLNET.AUTHENTICATION_SERVICES= (NONE)

 

DATA SOURCE

<asp:SqlDataSourceID="SqlDataSource1"runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString%>"

           ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName%>" SelectCommand='SELECT * FROM XYZ'>

           <SelectParameters>

 

 WEB CONFIG Entry

<

ORA-12154: TNS:could not resolve the connect identifier specified

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.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

 
[OracleException (0x80131938): ORA-12154: TNS:could not resolve the connect identifier specified
]
   System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) +84
   System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +688
   System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +135
   System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +37
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +512
  System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +102
   System.Data.OracleClient.OracleConnection.Open() +34
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

 

<div class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center>
</div>

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

How can I connect to oracle 11g database server?

$
0
0

How can I connect to oracle 11g database server? Which driver do I have to install on windows 7? Can anyone post example code to connect to oracle database server and select columns from table and display it on views?

Mysqldependency

$
0
0

Hi Guys May i Know which part is wrong for this i cant detect mysql change thought vb.net

	Private Sub StartSqlDependency()
		Try
			OpenLocalDBConnection()
			cnStringDependency = "User Id=" & DBUser & ";Password=" & DBPass & ";Host=" & DBServer & ";Database=" & DBDatabase & ";"
			connectiondependency = New Devart.Data.MySql.MySqlConnection(cnStringDependency)
			commandDependency = New Devart.Data.MySql.MySqlCommand("select * from tbltransaction", connectiondependency)
			dependency = New MySqlDependency(commandDependency, 100)
			AddHandler dependency.OnChange, AddressOf Me.dependency_OnChange
			MySqlDependency.Stop(connectiondependency.ConnectionString)
			MySqlDependency.Start(connectiondependency.ConnectionString)
			TransLog("MySqlDependency Start Successful.")
			View_Data()
			View_Batch()
			DataGridView_tbltransaction.DataSource = datagrid.DataSource
		Catch ex As Exception
			ExceptionLog("MySqlDependency Error on: {0} " + ex.Message + ex.StackTrace)
			MySqlDependency.Stop(cn.ConnectionString)
			CloseLocalDBConnection()
		End Try
	End Sub

	Private Sub dependency_OnChange(ByVal sender As Object, ByVal e As MySqlTableChangeEventArgs)
		View_Data()
		View_Batch()
		ManualUpdate()
		View_Data()
		View_Batch()
		DataGridView_tbltransaction.DataSource = datagrid.DataSource
	End Sub

Could not load type 'Devart.Data.MySql.MySqlDependency' from assembly 'Devart.Data.MySql

$
0
0

Hi, i would like to run mysqldependency on visual studio but im facing problem with error

Could not load type 'Devart.Data.MySql.MySqlDependency' from assembly 'Devart.Data.MySql, Version=8.10.1086.0, Culture=neutral, PublicKeyToken=09af7300eec23701'.

May i know what problem occur in this error? Urgent need help, thanks


Create event that updates tables/db every 5 minutes

$
0
0

I want to create an event that runs every 5 minutes updates all of the tables in one server and updates them to another server. Is this possible? I currently have to export by creating to a self-contained file from one server and import that file into the other server. 

Here is the script I have so far: 

DELIMITER $$ 

DROP EVENT IF EXISTS run_event $$ 

CREATE DEFINER=`root`@`%` 
EVENT `run_event` 
ON SCHEDULE EVERY 5 MINUTE STARTS '2018-04-04 00:00:00' 
ON COMPLETION NOT PRESERVE ENABLE 
DO 
BEGIN 
SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'run_event started'; 
CALL my_db; 
SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'run_event finished'; 
END $$

Integrated Security problem in Connection string

$
0
0

I have the following problem regarding oracle client connection string from .net web service, any help please?

Error Message: 'integrated security' is an invalid connection string attribute
Stack Trace:    at Oracle.ManagedDataAccess.Client.ConnectionString.SetProperty(String key, String value, String quotedValue)
   at Oracle.ManagedDataAccess.Client.ConnectionString.Parse(String constr)
   at Oracle.ManagedDataAccess.Client.ConnectionString..ctor(String constring)
   at Oracle.ManagedDataAccess.Client.ConnectionString.GetCS(String constr)
   at Oracle.ManagedDataAccess.Client.OracleConnection.set_ConnectionString(String value)
   at Oracle.ManagedDataAccess.Client.OracleConnection..ctor(String connectionString)
   at MyCode.DataAccess.Repository.insert(Company oCompany)

the connection string is 

<add connectionString="Persist Security Info=False;Integrated Security=False;Password=123;User ID=USER1;Data Source=testDB" name="ConnectionString" providerName="Oracle.DataAccess.Client" />

Mysql copy a row from one table to another but it duplicates

$
0
0

I am trying to copy a row from one table, using variable $year, into an identical table called $record_year.  The code I am using copies it over no problem, but it does it twice...and I only want one record.

Once a radio has been declared as "returned" I want the record updated (works), the record copied to the "record" table (half works), and then delete the original row (works).

See code for the copy: (please excuse the number of variable)

//copy completed record to `year`_record$conn = new mysqli($servername, $username, $password, $dbname);$sql = "INSERT INTO `$record_year` select id=null,ON_num,BMR_num,Current_Status,Received_on,Received_by,Received_at,Recycled_on,Recycled_by,Recycled_at,Boxed_on,Boxed_by,Boxed_at,Boxed_num,Returned_on,Returned_by,Returned_to,Return_staff,Repair_needed_on,Repair_needed_by,Repair_needed_from,Repair_sent_on,Repair_sent_by,Repair_received_on,Repair_received_by,Notes,last_updated_by,last_updated_date from `$year` where id = '$id'";$result = $conn->query($sql);
if ($conn->query($sql) === TRUE) 
{
	echo "Record moved to records successfully<br>";
} 
else 
{
	echo "Error: " . $sql . "<br>" . $conn->error;
}$conn->close();

Any ideas?

Thanks!

Failed to find or load the registered .Net framework data provider

$
0
0

I want to move my application from Development to Production.

It is working fine in the Development Server. But when moved to Production, I am getting the below error.

Failed to find or load the registered .Net framework data provider.

I am using Oracle db.

ORA-00604 & ORA-08177 with entity framework

$
0
0

hello all

i'm beginner in asp.net mvc and entity framework. and i have started following this example in github : https://github.com/abdelkafiahmed/BankManagementSystem

i creatd a new project MVC5 in visual studio 2012 ultimate, all model class (Banque, Client,...etc), and entity framework context class BankDbContext.

i have oracle database 12c version

Since there is not a connection string in web.config on this example, i decided to use entity framework for accessing to oracle database. i downloaded by nuget and installed the oracle.ManagedDataAccess.EntityFramework, oracle.ManagedDataAccess and EntityFramework v6 packages and t alrered the connection string given by thes packages to

<oracle.manageddataaccess.client><version number="*"><dataSources><dataSource alias="ORCL" descriptor="(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP)(HOST = localhost)(PORT =1521))(CONNECT_DATA =(SERVICE_NAME = orcl)))"/></dataSources></version></oracle.manageddataaccess.client><connectionStrings><add name="BankDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=bcdratest;Password=bcdratest;Data Source=ORCL"/></connectionStrings>

after i have created the Initializer class:

namespace BankAccountsManagementSystem.DataAccessLayer{publicclassInitializer:DropCreateDatabaseAlways<BankDbContext>{protectedoverridevoidSeed(BankDbContext context){


            using(var ctx =newBankDbContext()){var  banque =newBanque{Nom="ENIT Bank",ArgentDepose=0.0m,Capital=0.0m,NbreClients=0,NbreComptes=0,NbreCredits=0,SommeCredits=0};

                ctx.Banques.Add(banque);
                ctx.SaveChanges();}}}}

i have started by creating a BanquesController and Banques/Index view when i executed the application, the database is created in first time. after, i created PersonneMoralesController by scaffolding and altered the index Action by the code on this example

here

but when executing the application i get an exception:

ORA-00604: error occurred at recursive SQL level string1

ORA-08177: can't serialize access for this transaction

 and database is not recreated.

i thought that i have got these errors because of the codes in initializer and banque Controller Index Action, two transactions in same Banques table, so i excluded this Initializer Class File.

but even this, the problem persists when the exectioning of application

why and how to fix this?

soon

Connection Refused on phpMyAdmin

$
0
0

Hi,

I am facing a database connection problem. I am not sure what happens, but hope for experts' answers. :)

Here is my situation. I am developing an ASP .NET MVC web application using VS Community for MAC version 7.4.3 (build 10), and MAMP version 4.4.1.

I have do the following code and setup the database in phpMyAdmin provided by MAMP. Here are the details for the settings.

connection string in web.config:

<connectionStrings>
    <add name="SchoolSystem" connectionString="Data Source=localhost;port=3306;Initial Catalog=SchoolSystem;User ID=root;Password=root" providerName="MySql.Data.MySqlClient" />
  </connectionStrings>

Source code:

public ActionResult Add()
        {
            string mainConn = ConfigurationManager.ConnectionStrings["SchoolSystem"].ConnectionString;
            MySqlConnection mysql = new MySqlConnection(mainConn);
            string query = "SELECT * from UserRole;";
            MySqlCommand command = new MySqlCommand(query);
            command.Connection = mysql;
            mysql.Open();
            MySqlDataReader dr = command.ExecuteReader();
            while (dr.Read())
            {
                Console.WriteLine(dr["UserRoleID"].ToString());
                Console.WriteLine(dr["UserRoleName"].ToString());
                Console.WriteLine(dr["IsAll"].ToString());
                Console.WriteLine(dr["IsAddStudent"].ToString());
                Console.WriteLine(dr["IsDeleteStudent"].ToString());
                Console.WriteLine(dr["IsAddTeacher"].ToString());
                Console.WriteLine(dr["IsDeleteTeacher"].ToString());
            }
            mysql.Close();
            return View();
        }

phpMyAdmin configuration:

PHP

phpinfo shows the current configuration of PHP.

MySQL

MySQL can be administered with phpMyAdmin.

To connect to the MySQL server from your own scripts use the following connection parameters:

Hostlocalhost
Port3306
Userroot
Passwordroot
Socket/Applications/MAMP/tmp/mysql/mysql.sock

phpMyAdmin URL:

http://localhost:8888/phpMyAdmin/sql.php?db=SchoolSystem&table=UserRole&token=1cd40620cbc2325e1f15a1c443f327af&pos=0

Error message:

<div id="header"> <div id="header-text">Application Exception</div> </div> <div id="main">

System.Net.Sockets.SocketException

Connection refused

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.

<div>Exception stack trace:</div> <div class="details"></div> <div id="footer"> <div>Version Information:5.8.1.0 (2017-10/6bf3922f3fd Thu Mar 8 17:00:31 EST 2018); ASP.NET Version:4.0.30319.42000</div> </div> </div>

Appreciate any help provided.

Creating Audit table in Sql server

$
0
0

Hi Friends,

My requirement is to make Audit table something like having columns FieldName,oldValue,NewValue,TableName,PK_id ,Action.

I want log of any insert/Update in multiple table using trigger.

Thanks


Can we use Interop to open and save an Excel on web server

$
0
0

On IIS I have installed an Excel program.
Then I save an Excel file also to App_Data folder on this same IIS machine.

I wish to see if we can use interop or others so my asp page can open that Excel file on IIS and let it does its own calculation (just like when it does its own on desktop) and save it to the same App_Data file location ?

Is this something impossible ?
Thanks

How to get the values from multiple rows after comparing certain columns??

$
0
0

Hi,

i am trying to get the values from multiple rows from oracle table. query condition would be something like if project_num, building_id, Physical_inspect_date and phy_cond are same then compare the values from Repair_Time column and get the maximum value and return the same row values for Deficiency_code, life_safety, on_prior_rep. please have a look at below screen shot to have idea. in that case i would like to get values from first row as repair time is greater than second row. Values should return C, *, Y, 4.

Project_numBuilding_IdPhysical_Inspect_DatePhy_CondDeficiency_CodeLife_SafetyOn_Prior_RepRepair_Time
60000225596/8/2018ExteriorC*Y4
60000225596/8/2018ExteriorMN2

Thanks in Advanced!

How to get results from multple queries into one table in MySQL stored procedure

$
0
0

I have the queries below in one stored procedure and want to put the results of those queries into one tmp table. How do I do that?

        CREATE DEFINER=`server`@`%` PROCEDURE `GetMonthlyRate`()
         BEGIN

        SELECT OH.ActualWeight, OH.ServiceDate
        FROM OperationsHaul OH                        
        WHERE OH.RecordDisabled = 0 AND
        CCT.CoreContentTypeCategoryID = 1;




        SELECT OH.ActualWeight, OH.IsRecycleContaminated, 
        OH.RecycleContaminationPercent, OH.RecycleRebatePercent, 
        OH.CoreContentTypeID, OH.ServiceDate
        FROM OperationsHaul OH  
        WHERE OH.RecordDisabled = 0 AND
        CCT.CoreContentTypeCategoryID = 1;



        SELECT OH.ActualWeight, OH.IsRecycleContaminated, 
        OH.RecycleContaminationPercent,
        FROM OperationsHaul OH  
        WHERE OH.RecordDisabled = 1 AND
        CCT.CoreContentTypeCategoryID = 1;

       END

Is it a CREATE TABLE or INSERT??

Urgent help needed : Web based mysql database

$
0
0

I'm an intern in a company

and I'm asked to programm sth for another company

I'm supposed to prepare a software interface of 2 different forms.

the forms will have numerous functions, but to summarize it;

one will be a project tracking software, and other is to be an offer-order tracking software.

--------------

I will start studying computer science next year.  I don't even know where to start now...

I've visual studio 2017 downloaded and used only visual basic and a li'l bit of C# so far.

I've also completed a couple networking courses on gns3 and cisco packet tracer

I've never used Mysql, although I don't think it is that hard to learn about it.

---------------------

Please tell me what to do, or at least WHERE TO START ??

Should I use asp.net ? php? or what ? I don't know anything at all..

Help me please, I'm too young to get stressed.

Argument exception was unhandled by user code

$
0
0

An exception of type 'System.ArgumentException' occurred in System.Data.dll but was not handled in user code.

Additional information: unable to find the requested .Net Framework Data Provider.  It may not be istalled. 

Throwing this exception at:  var db = DatabaseFactory.CreateDatabase("AAAAA");

Viewing all 1350 articles
Browse latest View live