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

Asp.Net Connection Pool Timeout With Oracle 11g

$
0
0

Hi,

I am getting the following error:

Mensagem de erro: A solicitação de conexão com pools sofreu timeout 

Rastreamento de Pilha: at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)
at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)
at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)
at Oracle.ManagedDataAccess.Client.OracleConnection.Open()
at WebUserControls_wucCadastraDadosAlfas.busca_NomeComunidade(String cod_mun, String cod_macro, String cod_pis, String cod_pif) in c:\inetpub\wwwroot\diasmelhores\alfa\WebUserControls\wucCadastraDadosAlfas.ascx.cs:line 893
at WebUserControls_wucCadastraDadosAlfas.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\diasmelhores\alfa\WebUserControls\wucCadastraDadosAlfas.ascx.cs:line 97
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.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I'm running the application in a Windows Server 2008 R2 64bit, using a IIS 6.1.

My data is stored in a Oracle 11g R2.

I use the Oracle.ManagedDataAccess Nugget package version 12.2.1100.


PL/SQL to C# converter

$
0
0

Does anyone know of a PL/SQL to C# converter that is out there?

MySql Database IN VB.NET 2010

$
0
0

I am using MySql5.7 in VB.NET 2010. I want to create another data directory other than system data directory through vb.net dynamically on other drivers and also create a database at the newly created data directory and tables are also created at runtime.

When we install MySQL server it installs on os drive and the database is stored on program data/mysql5.7/data. This is the default dir but I want another data dir other than default dir and that is not on os drive.

When we install MySQL server it installs on os drive and the database is stored on program data/mysql5.7/data. This is the default dir but I want another data dir other than default dir and that is not on os drive.

Reading Drop down Values Lists in Excel File.

$
0
0

Hi Friends,

I have to upload Excel file containing bulk data in Excel sheet which contains rows with  Plain Text/Drop down lists.   Reading the the plain text is simple  using Open XML,   But I really don't know how  I can read the value of the  drop down in Excel ....?

Can any one provide example?

Thanks!

How to add row to view that contains the total (MySQL)

$
0
0

I know this question has been asked before but I've been trying the solutions and I'm still getting errors.

I've created a view to view the quantity of life jackets by size:

---------------LIFE JACKET LIST------------

CREATE VIEW Life_Jacket_List AS

SELECT size,SUM(quantity) AS Quantity

FROM life_jackets LEFT JOIN equipment USING(model)

GROUP BY size with ROLLUP

Which looks like this:

sizeQuantity
L48
M39
S35
NULL122

Basically I just want to change the "null" to "Total". Here is what I've done so far:

CREATE VIEW Life_Jacket_List AS

SELECT size, size = ISNULL(size, ‘Total’), TotalLife = SUM(quantity), SUM(quantity AS Quantity

FROM life_jackets LEFT JOIN equipment USING(model)

GROUP BY size with ROLLUP

I'm getting an error though:

1582 - Incorrect parameter count in the call to native function 'ISNULL'

Any idea on how to fix this?

selecting records that are 90 days from expiring

$
0
0

Dear all,

I got 5 records. If today is 2018-12-04.

How can I select records which are expiring in 90 days?

No, end_date
1, 2018-11-15
2, 2019-12-31
3, 2019-02-13
4, 2019-03-04
5, 2019-05-02

Below is my SQL statement. how can I make it to show record no 1-4?

SELECT * FROM customer_agreement WHERE end_date <= DATE(NOW() + INTERVAL 90 DAY) + INTERVAL 0 SECOND ORDER BY end_date DESC





Quick Question for Oracle Set define off query

$
0
0

Hi All, 

I just want to know that if i turned off the feature i.e. "SET DEFINE OFF" from my oracle database, will there by any consequences / disadvantages with my data or database, as i really need to turn it off for some queries. 

Please advise if it will not break anything.

This SqlTransaction has completed; it is no longer usable.” why am i getting this error

$
0
0

Why am i getting System.InvalidOperationException: 'This SqlTransaction has completed; it is no longer usable.'??

There is no error in the code they why then  is  it running code inside catch block?

string s = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

protected string GetValue(ListItemCollection list, int[] a)
{
string value = "";
for (int i = 0; i < a.Length; i++)
{
value += list[a[i]].Text.Trim() +",";
}

return value;
}


protected bool Check(int[] a)

{
    if (a.Length > 0){  
      return true;}
    else {
      return false;
}

protected void Button1_Click(object sender, EventArgs e)
{       using (SqlConnection con = new SqlConnection(s))

{
      int row = 0;
      int a = 0;
      con.Open();
      using (SqlCommand com = new SqlCommand("select * from UserData where Email='" + TextBox12.Text + "'", con))
      {

        using (SqlDataReader dr = com.ExecuteReader())
        {
        if (dr.HasRows)
        {
        Label7.Text = "Email Already Exists"+" ";
        row++;
        }  }         }



      if (row == 0)
      {
      SqlTransaction t = con.BeginTransaction();

      try
{

using (SqlCommand com = new SqlCommand("insert into UserData values(@Email,@Password,@UserName,@Number,@ClassOwner)", con))
{
com.Transaction = t;
com.Parameters.AddWithValue("@Email", TextBox12.Text);
com.Parameters.AddWithValue("@Password", TextBox8.Text);
com.Parameters.AddWithValue("@UserName", TextBox11.Text);
com.Parameters.AddWithValue("@Number", TextBox10.Text);
com.Parameters.AddWithValue("@ClassOwner", 1);
com.ExecuteNonQuery();
}
using (SqlCommand com = new SqlCommand("insert into ClassData values(@Email,@ClassName,@City,@Area,@FullAddress,@WebSite,@NumberOfBranch)", con))
{
com.Transaction = t;
com.Parameters.AddWithValue("@Email", TextBox12.Text);
com.Parameters.AddWithValue("@ClassName", TextBox1.Text);
com.Parameters.AddWithValue("@City", DropDownList1.SelectedItem.Text);
com.Parameters.AddWithValue("@Area", DropDownList2.SelectedItem.Text);
com.Parameters.AddWithValue("@FullAddress", TextBox5.Text);
com.Parameters.AddWithValue("@WebSite", TextBox7.Text);
com.Parameters.AddWithValue("@NumberOfBranch", 0);
com.ExecuteNonQuery();
}
if (Check(ListBox4.GetSelectedIndices()) || Check(ListBox2.GetSelectedIndices()) || Check(ListBox3.GetSelectedIndices()) || Check(ListBox5.GetSelectedIndices()) || Check(ListBox11.GetSelectedIndices()) || Check(ListBox12.GetSelectedIndices()) || Check(ListBox60.GetSelectedIndices()) || Check(ListBox6.GetSelectedIndices()) || Check(ListBox7.GetSelectedIndices()) || Check(ListBox8.GetSelectedIndices()) || Check(ListBox61.GetSelectedIndices()))
{

using (SqlCommand com = new SqlCommand("insert into Education1 values(@Email,@ClassName,@Primary,@Medical,@Enginnering,@Law,@Science,@Commerce,@Arts,@Architecht)", con))
{
com.Transaction = t;
string prime = GetValue(ListBox4.Items, ListBox4.GetSelectedIndices()) + GetValue(ListBox2.Items, ListBox2.GetSelectedIndices()) + GetValue(ListBox3.Items, ListBox3.GetSelectedIndices()) + GetValue(ListBox5.Items, ListBox5.GetSelectedIndices());
com.Parameters.AddWithValue("@Email", TextBox12.Text);
com.Parameters.AddWithValue("@ClassName", TextBox1.Text);
com.Parameters.AddWithValue("@Primary", prime);
com.Parameters.AddWithValue("@Medical", GetValue(ListBox11.Items, ListBox11.GetSelectedIndices()));
com.Parameters.AddWithValue("@Enginnering", GetValue(ListBox12.Items, ListBox12.GetSelectedIndices()));
com.Parameters.AddWithValue("@Law", GetValue(ListBox60.Items, ListBox60.GetSelectedIndices()));
com.Parameters.AddWithValue("@Science", GetValue(ListBox6.Items, ListBox6.GetSelectedIndices()));
com.Parameters.AddWithValue("@Commerce", GetValue(ListBox7.Items, ListBox7.GetSelectedIndices()));
com.Parameters.AddWithValue("@Arts", GetValue(ListBox8.Items, ListBox8.GetSelectedIndices()));
com.Parameters.AddWithValue("@Architecht", GetValue(ListBox61.Items, ListBox61.GetSelectedIndices()));
com.ExecuteNonQuery();
}
}
if (Check(ListBox63.GetSelectedIndices()) || Check(ListBox52.GetSelectedIndices()) || Check(ListBox36.GetSelectedIndices()) || Check(ListBox53.GetSelectedIndices()) || Check(ListBox49.GetSelectedIndices()))
{

using (SqlCommand com = new SqlCommand("insert into Education2 values(@Email,@ClassName,@CivilAviation,@Radio,@Acting,@Multimedia,@Vocational)", con))
{
com.Transaction = t;
com.Parameters.AddWithValue("@Email", TextBox12.Text);
com.Parameters.AddWithValue("@ClassName", TextBox1.Text);
com.Parameters.AddWithValue("@CivilAviation", GetValue(ListBox63.Items, ListBox63.GetSelectedIndices()));
com.Parameters.AddWithValue("@Radio", GetValue(ListBox52.Items, ListBox52.GetSelectedIndices()));
com.Parameters.AddWithValue("@Acting", GetValue(ListBox36.Items, ListBox36.GetSelectedIndices()));
com.Parameters.AddWithValue("@Multimedia", GetValue(ListBox53.Items, ListBox53.GetSelectedIndices()));
com.Parameters.AddWithValue("@Vocational", GetValue(ListBox49.Items, ListBox49.GetSelectedIndices()));
com.ExecuteNonQuery();

}
}
if (Check(ListBox37.GetSelectedIndices()) || Check(ListBox64.GetSelectedIndices()) || Check(ListBox65.GetSelectedIndices()))
{
using (SqlCommand com = new SqlCommand("insert into Others values(@Email,@ClassName,@Dance,@Sport,@Music)", con))
{
com.Transaction = t;
com.Parameters.AddWithValue("@Email", TextBox12.Text);
com.Parameters.AddWithValue("@ClassName", TextBox1.Text);
com.Parameters.AddWithValue("@Dance", GetValue(ListBox37.Items, ListBox37.GetSelectedIndices()));
com.Parameters.AddWithValue("@Sport", GetValue(ListBox64.Items, ListBox64.GetSelectedIndices()));
com.Parameters.AddWithValue("@Music", GetValue(ListBox65.Items, ListBox65.GetSelectedIndices()));
com.ExecuteNonQuery();

}
}


HttpCookie cookie = new HttpCookie("MyEmail");
cookie["MyEmail"] = TextBox12.Text;
cookie["MyName"] = TextBox11.Text;
cookie.Expires = DateTime.Now.AddHours(24);
Response.Cookies.Add(cookie);
t.Commit();

Response.Redirect("Home2.aspx");}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
if (con.State == ConnectionState.Open)
{
con.Close();
}
t.Rollback();
}}}}


MYSQL Select inner join of two tables returns data just from one table

$
0
0

Hi,

I use MySQL Select with inner join to return data from database.

But select with inner join of two tables returns only the data from the left table. I tried with left/right join, but same happens.

Can anybody help me why it is happening please?

This is my MYSQL Select:

string query = "SELECT t1.*, t2.* FROM t1 INNER JOIN t2 ON t1.ACCT=t2.ACCT WHERE t1.ACCT=t2.ACCT";

Thank you!

error while hosting web service

$
0
0

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Getting error executing stored procedure while debugging/ running on on localhost

$
0
0

Hi all

I am getting the below error while running a web application. The web form consists of a file upload control that uploads excel file, read the cells and input them into the db. The inserting is done via stored procedure. The thing is, it was working fine until I chose to change Server Properties under the Project Properties>Web. I wanted to the debug directly on the IIS instead of using IIS Express. I was initially getting the error not being able to login, but I change the App Pool Identity to Network Service. I was getting a chain of errors like unable to run the execute or select permission which I have solved by running the query directly on SQL Server. However, I don't think running the query all the time solve the issue, how can I solve it once and for all . 

The tblename1 is a user defined table type ( I am not really good in sql server, but I assume this was created by the stored procedure )

NameValueType
ex{"The EXECUTE permission was denied on the object 'tblname1', database 'OMdb', schema 'dbo'."}System.Exception {System.Data.SqlClient.SqlException}

'System.OutOfMemoryException' for documentformat.open xml

$
0
0

Hi

I have 1000000 plus records in my datatable.

I need create excel using those records in datatable.

I am using documentformat.openXMl.

I am getting "System.OutOfMemoryException" error.

here is my code

static void Main(string[] args)
        {
           String sFile = "C:\\Users\\xyz\\Documents\\test2.xlsx";
            if (File.Exists(sFile))
            {
                File.Delete(sFile);
            }
            DataTable dt = Select * from EMP;//get data from DB table
           

            using (SpreadsheetDocument spreedDoc = SpreadsheetDocument.Create(sFile,
       DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook))
            {
                WorkbookPart wbPart = spreedDoc.WorkbookPart;
                if (wbPart == null)
                {
                    wbPart = spreedDoc.AddWorkbookPart();
                    wbPart.Workbook = new Workbook();
                }
                WorksheetPart worksheetPart = wbPart.AddNewPart<WorksheetPart>();
                worksheetPart.Worksheet = new Worksheet();
                WorkbookStylesPart stylePart = wbPart.AddNewPart<WorkbookStylesPart>();
                stylePart.Stylesheet = GenerateStylesheet();
                stylePart.Stylesheet.Save();
                Columns columns = new Columns(
                        new Column // Id column
                        {
                            Min = 1,
                            Max = 3,
                            Width = 24,
                            CustomWidth = true
                        },
                        new Column // Name and Birthday columns
                        {
                            Min = 4,
                            Max = 4,
                            Width = 15,
                            CustomWidth = true
                        },
                        new Column // Salary column
                        {
                            Min = 5,
                            Max = 6,
                            Width = 8,
                            CustomWidth = true
                        });

                worksheetPart.Worksheet.AppendChild(columns);
                Sheets sheets = wbPart.Workbook.AppendChild(new Sheets());

                Sheet sheet = new Sheet() { Id = wbPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Exception" };

                sheets.Append(sheet);
                wbPart.Workbook.Save();
                SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData());

                var workingSheet = ((WorksheetPart)wbPart.GetPartById(sheet.Id)).Worksheet;              
                Int32 rowindex = 1;
                Row row = null;
                for (int i=0;i<3;i++)
                {
                   row = new Row();
                    row.RowIndex = (UInt32)rowindex;
                    if (rowindex == 1)
                    {
                        row.Append(ConstructCell("STRUCT",CellValues.String,3));
                    }
                    else if (rowindex == 2)
                    {
                        row.Append(ConstructCell("testtest", CellValues.String,4));
                    }
                    else if (rowindex == 3)
                    {
                        row.Append(ConstructCell("Run Date:", CellValues.String, 5) , ConstructCell("testdate", CellValues.String,0));
                    }
                    sheetData.AppendChild(row);
                    rowindex++;
                }
                rowindex = 5;
                foreach (DataRow emp in dt.Rows) //app dt.Rows.count=1000000
                {
                    row = new Row();
                    row.RowIndex = (UInt32)rowindex;

                    if (rowindex == 5) //Header 
                    {
                       row.Append(ConstructCell("Name", CellValues.String, 2),ConstructCell("Email", CellValues.String, 2));
                   }
                   else
                 {
                        row.Append(ConstructCell(emp[0].ToString(), CellValues.String,1),
                            ConstructCell(emp[1].ToString(), CellValues.String, 1),
                            ConstructCell(emp[2].ToString(), CellValues.String, 1),
                            ConstructCell(emp[3].ToString(), CellValues.String, 1),
                            ConstructCell(emp[4].ToString(), CellValues.Number,1),
                            ConstructCell(emp[5].ToString(), CellValues.String, 1),

                             ConstructCell(emp[6].ToString(), CellValues.String, 1),
                            ConstructCell(emp[7].ToString(), CellValues.String, 1),
                            ConstructCell(emp[8].ToString(), CellValues.String, 1),
                            ConstructCell(emp[9].ToString(), CellValues.Number,1),
                            ConstructCell(emp[10].ToString(), CellValues.String, 1),

                            ConstructCell(emp[11].ToString(), CellValues.String, 1)

                  );
                   }

                   sheetData.AppendChild(row);
                   rowindex++;
               }             

                    sheetData.AppendChild(row);                    
                    Console.WriteLine(j);

                    rowindex++;

                }

                
                MergeCells mergeCells = new MergeCells();
               
                mergeCells.Append(new MergeCell() { Reference = new StringValue("A1:C1") });
                mergeCells.Append(new MergeCell() { Reference = new StringValue("A2:C2") });               
                worksheetPart.Worksheet.InsertAfter(mergeCells, worksheetPart.Worksheet.Elements<SheetData>().First());              
                worksheetPart.Worksheet.Save();
            }
        }
      
        private static Cell ConstructCell(string text,CellValues dataType,uint styleIndex)
        {
            return new Cell()
            {
                CellValue = new CellValue(text),
                DataType = new EnumValue<CellValues>(dataType),               
                StyleIndex = styleIndex
            };

        }      
        private static Stylesheet GenerateStylesheet()
        {
            Stylesheet styleSheet = null;

            Fonts fonts = new Fonts(
                new Font( // Index 0 - default
                    new FontSize() { Val = 10 },
                    new FontName() { Val = "Arial" }
                ),
                new Font( // Index 1 - header
                    new FontSize() { Val = 10 },
                    new Bold(),                  
                    new FontName() { Val = "Arial" }
                ),
                new Font( // Index 2 - header
                    new FontSize() { Val = 12 },
                    new Bold(),
                    new FontName() { Val = "Arial" }),
                 new Font( // Index 3 - header
                    new FontSize() { Val = 14 },
                    new Bold(),
                    new FontName() { Val = "Arial" },
                    new Underline() { Val = UnderlineValues.Single }),
                 new Font( // Index 4 - header
                    new FontSize() { Val = 10 },
                    new Bold(),
                    new FontName() { Val = "Verdana" },
                    new Color() { Rgb = "FFFFFF" })
                );

            Fills fills = new Fills(
                     new Fill(new PatternFill() { PatternType = PatternValues.None }), // Index 0 - default
                     new Fill(new PatternFill() { PatternType = PatternValues.Gray125 }), // Index 1 - default
                     new Fill(new PatternFill(new ForegroundColor { Rgb = new HexBinaryValue() { Value = "477344" } })
            { PatternType = PatternValues.Solid }) // Index 2 - header


                );

            Borders borders = new Borders(
                    new Border(), // index 0 default
                    new Border( // index 1 black border
                        new LeftBorder(new Color() { Auto = true }) { Style = BorderStyleValues.Thin },
                        new RightBorder(new Color() { Auto = true }) { Style = BorderStyleValues.Thin },
                        new TopBorder(new Color() { Auto = true }) { Style = BorderStyleValues.Thin },
                        new BottomBorder(new Color() { Auto = true }) { Style = BorderStyleValues.Thin },
                        new DiagonalBorder())
                );

            CellFormats cellFormats = new CellFormats(
                    new CellFormat (),// default
                    new CellFormat { FontId = 0, FillId = 0, BorderId = 1, ApplyBorder = true }, // body
                    new CellFormat { FontId = 4, FillId = 2, BorderId = 1, ApplyFill = true,Alignment=new Alignment { Horizontal = HorizontalAlignmentValues.Center } }, // header
                    new CellFormat { FontId = 3, FillId = 0, BorderId = 0},
                    new CellFormat { FontId = 2, FillId = 0, BorderId = 0 },
                    new CellFormat { FontId = 1, FillId = 0, BorderId = 0 }
                );          
            styleSheet = new Stylesheet(fonts, fills, borders, cellFormats);

            return styleSheet;
        }

MySQL .Net Core documentation is very poor. Is there any other solution?

$
0
0

Hi All,

I am trying to connect my existance MySQL db from my new .Net core project. Tried to follow this document and failed. https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials.html

because it uses command line for results however .net core uses complately different interface (MVC) system.

Could you help me to find a good and clear documentation to follow to connect to MySQL via MySQL.Data.EntityFramework package.

thanks

Select query

$
0
0

SELECT *FROMxxtec_tss_exp_receipt_lines_ifWHERE NUMBER='10'AND ITEMSs=NVL(:ITEM, ITEMSs)

it is working in toad

HOW CAN I do thi in vb.net. Thanks

oracle xmltype question

$
0
0

i have a table with 2 column, 1st is ID and 2nd is xml data with data type 'xmltype'

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

id         xmldata

1          <row id='1'><a1>name</a1><a2>address1</a2><a3>tel1</a3><a3 m='2'>20181231</a3><a3 m='3'>date3</a3></row>

2          <row id='2'><a1>name2</a1><a2>address2</a2><a3>tel2</a3><a3 m='2'>20181111</a3><a3 m='3'>date4</a3></row>

3          <row id='3'><a1>name3</a1><a2>address3</a2><a3>tel3</a3><a3 m='2'>20181231</a3><a3 m='3'>date5</a3></row>

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

now i would like to select all the records node <a3 m='2'> = '20181231' to update to '20181230'

----------- expected result

id         xmldata

1          <row id='1'><a1>name</a1><a2>address1</a2><a3>tel1</a3><a3 m='2'>20181230</a3><a3 m='3'>date3</a3></row>

2          <row id='2'><a1>name2</a1><a2>address2</a2><a3>tel2</a3><a3 m='2'>20181111</a3><a3 m='3'>date4</a3></row>

3          <row id='3'><a1>name3</a1><a2>address3</a2><a3>tel3</a3><a3 m='2'>20181230</a3><a3 m='3'>date5</a3></row>

-----------

my sql is as below it seems failure to return my expected result

update customer set xmldata= updatexml( xmldata, '/row/a3[m='2'], '20181230') where extractvalue( xmldata, 'row/a3[m='2']')='2081231'

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

now i would like to select all the records node <a3 m='2'> = '20181231' to update to '20181230'

how can i prepare a update sql to do that? any sql example? as my sql above can't return my expected result.


'OraOLEDB.Oracle' provider is not registered on the local machine, when working with a console application

$
0
0

I have a very similar situation as described in below thread:

The 'OraOLEDB.Oracle' provider is not registered on the local machine, when working with a console application?

I have website application .Net 4.5, on windows server 2016 and vs2017 with configuration as 'Any CPU'. I have a service layer to connect to oracle database and get the data. It runs very fine and connect to oracle database.

Now, i have a console application to run a job and once this job completes, i need to update the database. I call service layer from console application to update the database. However this call fails, and gives me 'The 'OraOLEDB.Oracle' provider is not registered on the local machine' error.

Solution provided in above given post (i.e. compile your console app in x86) does work for me but i don't have this option (as i have dependency on some other things as well).

Do i have any other option to resolve this issue?

How to stop MySQL.Data Entityframework to delete underscore from field names while scaffolding

$
0
0

Hi all,

I am trying to scaffold an existant MySQL db to ORM as described here

https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html

however, I can not stop the mechanism to change field names from this; raporu_cikartan_lab to this; RaporuCikartanLab

Normally it would be great (I like the second name convention "RaporuCikartanLab") however after that system cannot find those fields in the table when I try to reach them via entityframework.

Where can be the problem and how can I solve this?

how to update xmltype node

$
0
0

anyone knows how to update xmltype node.

Before update
------------------------
<row id="1">
  <a1>name</a1>
  <a2>address1</a2>
  <a3>tel1</a3>
  <a3 m="2">20181231</a3>
  <a3 m="3">date3</a3>
</row>



After Update
------------------------
<row id="1">
  <a1>name</a1>
  <a2>address1</a2>
  <a3>tel1</a3>
  <a3 m="2">20181230</a3>
  <a3 m="3">date3</a3>
</row>
*/

i would like to update node<a3 m="2">20181230</a3>

any oracle 12g sql exmaple?

oracle error - ora-01427

$
0
0

my sql don't have subquery but i don't know why it will return error:  ora-01427 signle-row subquery retruns more than 1 rows

define as xmltype in oracle table column. 

<row id='1'><a1>name</a1><a2>address1</a2><a3>tel1</a3><a3 m='2'>20181231</a3><a3 m='3'>date3</a3></row>

my sql is as below:

select extractValue(xmltype,'/row/c1[position()=1]'), extract (xmltype,'/row/c3') from table_a;

Use CodeFirst to Rename Table fields

$
0
0

Hi All,

I used database first approach to create my entities.

It worked really great and turned my fields' names from my_old_field_names to MyOldFieldNames and also created relation with my_old_field_names in db to MyOldFieldNames in entity.

However I want to go 1 step more and instead of that "relation" I want to convert all the table field names from my_old_field_names to MyOldFieldNames 

can  I use codefirst to do this and how?

thank you

Viewing all 1350 articles
Browse latest View live


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