MySQL 4.0.16 does NOT support subqueries. Help needed in writing alternative SQL.




I just figured out that MySQL 4.0.16 does NOT support subqueries/nested selects. Please help me write a query that will look like the above, without using subqueries.
Posted On: Tuesday 20th of November 2012 04:15:45 AM Total Views:  429
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




connection to mysql? URGENT!!!!! Please help!!

Can anyone help me on connection to mysql from asp.net
VIEWS ON THIS POST

208

Posted on:

Wednesday 7th November 2012
View Replies!

Code generation tool for mysql

I need a code generation tool for mysql, which generate DAL for my database. Please suggest me both open souce and close source solution.
VIEWS ON THIS POST

106

Posted on:

Wednesday 7th November 2012
View Replies!

Any other component to connect to mysql?

I am currently using Mysql Connector to connect to mysql database, but face problems when try to upload it into the web host company. http://forums.asp.net/1/1314486/ShowThread.aspx i know there is several way to connect to mysql (mysql connector, Odbc, ByteFx, CoreLabs). I wanted to try ByteFx and CoreLabs. But did not know which version to use. Any one have any links Suggestion Hopefully the ByteFx and CoreLabs is easy to used like mysql connector.
VIEWS ON THIS POST

137

Posted on:

Wednesday 7th November 2012
View Replies!

sql express to mysql

Is there a tool or easy way to convert or use my sql express dbase with a host that supports the 2.0 .NET, but supports mysql. I'm using sql express 2005 of course w/ Visual Web developer 2005 trying to get a login page w/ rules and roles to work.
VIEWS ON THIS POST

127

Posted on:

Wednesday 7th November 2012
View Replies!

update into mysql

hello, first read http://forums.asp.net/thread/1289007.aspx now I want to ask if someone can help me make a code to edit the data in my database and then update it. all I need is a little sample.
VIEWS ON THIS POST

163

Posted on:

Wednesday 7th November 2012
View Replies!

UPload files in mysql plz urgent help me

i am using vb.net/asp.net i want to upload files to mysql data base buti dont know the code if anyone know the code plz give it to me without using C# cos i am working in project and i did the connection and everything bu i cant upload files in the mysql data base
VIEWS ON THIS POST

212

Posted on:

Wednesday 7th November 2012
View Replies!

null reference on mysql

I'm an ASP.net novice. Here's the problem: when I try to access a row (db is mysql) that has a null value I get an error. This is my code: if (txtIDParterre.Value.Trim().Length > 0) \t \t \t \t \t \t\t\t \t { \t \t \t \t \t if (arrParterre.Length > 0) \t \t \t \t \t { \t \t \t \t \t \t \t \t \t \t \t \t txtParterre.Text = arrParterre[0].Parterre.Trim(); \t \t \t \t \t \t txtParterreEdit.Text = arrParterre[0].EditTuls.Trim(); \t\t\t\t\t\t\t //error happens on the above line when it is null, if it's an empty string than it's ok \t \t \t \t \t \t \t txtParterreQuat.Text = arrParterre[0].Quat.Trim(); \t \t \t \t \t \t \t \t \t \t \t } \t \t \t \t } \t \t .... \t Any idea
VIEWS ON THIS POST

112

Posted on:

Wednesday 7th November 2012
View Replies!

mysql 4.0.20

hi, \t i am using microsoft visual studio .net(C#), mysql 4.0.20(apache and linux). do i need to upgrade the mysql 4.0.20 what's the mysql version that is recommended today i also using MySQL ODBC 3.51 Driver is this ok any suggestions
VIEWS ON THIS POST

172

Posted on:

Wednesday 7th November 2012
View Replies!

probs adding info to mysql db with asp.net

im using asp.net to connect to a mysql database with odbc but im having a problem.Basically,ive set up a registration.aspx page to take in a users username,password and email.Im not getting any error messages when the code was compiled and it seemed to be okay,but after i type in the details into the form and click the submit button,i check the mysql database to see if the info has been added to the database-but it hasnt. Instead a new row has been added but all the values of this row are null...im not experienced with this but it wold seem that the actual connection to the database is okay because it is adding a row,it just isnt inserting the values that ive typed into the form. Can anyone help with this pleaseAny suggestions are appreciated as im completely lost. heres the code im using: DimConnStrAsString="Driver={MySQLODBC3.51Driver};Server=localhost;Database=customers;uid=root;pwd=emma;option=3" DimconnAsOdbcConnection=NewOdbcConnection(ConnStr) DimCmdAsOdbcCommand SubAddCredentials_Click(sAsObject,eAsEventArgs) Cmd=NewOdbcCommand("INSERTINTOUsers(Username,Pass,Email)VALUES(@Username,@Pass,@Email)",conn) Cmd.Parameters.Add("@Username",odbctype.varchar,10).value=txtusername.text Cmd.Parameters.Add("@Pass",odbctype.varchar,10).value=txtpassword.text Cmd.Parameters.Add("@Email",odbctype.varchar,20).value=txtemail.text Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() EndSub UserRegistration Username: Password: Email:
VIEWS ON THIS POST

148

Posted on:

Wednesday 7th November 2012
View Replies!

How to check mysql connection open

Can someone please provide me some code to check if mysql connection is open. Basically sometimes my host's mysql down and if there is a piece of code that detects it is down then it use MS Access db intead.
VIEWS ON THIS POST

118

Posted on:

Wednesday 7th November 2012
View Replies!

How to store a date in mysql

Hi! I'm having a problem storing date values in my MySql database. In my code, I create a Date object like this: Dim myDate As Date = New Date(2004, 11, 5) And I try to store it in this way: cmdInsert.Parameters.Add("@date", OleDbType.Date, 0).Value = myDate I've also tried with OleDbType.DBDate, but I get the same result. It worked fine with access database, but when I switched over to MySql, it won't work. Anybody know how to solve this Do I need to convert my date object or something Thnx! asgi
VIEWS ON THIS POST

108

Posted on:

Wednesday 7th November 2012
View Replies!

HELP! using mysql .net ODBC data provider as backend for excel 2000 automation..

Ok, here's the deal. I am trying very hard to use MySQL as a backend for ASP.NET development (which works fine), and trying to create a reporting section that generates excel reports using Excel 2000. Has anyone tried this and is it feasible. Needless to say I am running into all sorts of problems. The MySQL odbc .net provider works fine and is able to connect to the database. for all other regular asp.net programming. eg. populating listboxes, databinding the datagrids, datasets etc. works perfectly. Enter excel 2000 reports; I have tried automating this through ASP.NET but it gives me a lot of COM exception type errors. I added a reference to the Excel 10.0 library in my visual studio.net solution, and its imported Excel, Office and something called VBIDE as references. Now, I am able to write to an excel cell using automation but not when the query is from the database. However the same thing works from within the actual Excel application (when its not automated.) I am confused about whether: 1. Something is wrong with the MySQL driver when automating excel 2. Something is wrong with trying to automate Excel 2000 using ASP.NET anyone with any knowledge about this please enlighten me,
VIEWS ON THIS POST

260

Posted on:

Wednesday 7th November 2012
View Replies!

New to mysql database

I have create web application using asp.net and database is sql server. Now i am facing a problem because i need to shift my database to mysql (window). I want to ask about : a) Is ASP.NET fully support mysql database b) How i connect to mysql database What code need i write c) What reference book recommended for mysql database d) I am currently using store procedure in microsoft sql server. What i need to change when i change to mysql server Mysql currently does not support for store procedure right e) What much different when i shift from sql server to mysql f) What i need to do first Please kindly reply to me as soon as possible. I want to transfer it immediately. I will appreciate all help from you! p/s i am new to mysql
VIEWS ON THIS POST

101

Posted on:

Wednesday 7th November 2012
View Replies!

mvc3 website and using a mysql database

In php, it was easy to make a connectionstring and query the mysqldatabase with normal SQL in the code to get data from tables in a mysql database. In MVC3 there is many ways to do it and i want to know the easy way for a beginner. Should i use EF, ADO.Net Should i go with a different database then mysql Im so used with phpmyadmin so thats why i picked it. I think im making this harder then it is so i would gladly take an explanation to get my first data readout on my homepage from a simple mysqldatabase. My website is not advanced so i need the easiest way to write and read data. I look forward for someone to clear this up for me.
VIEWS ON THIS POST

172

Posted on:

Tuesday 20th November 2012
View Replies!

mysql odbc with providers

Hi folks, I am trying to use mysql odbc with role and membership providers. Is it possible Is there any special arregements TIA Moises
VIEWS ON THIS POST

255

Posted on:

Tuesday 20th November 2012
View Replies!

Importing excel to mysql

PLEASE HELP!!!!!!!!!!!!!!!!!Hi I am trying to import the excelsheet data to mysql database and data is also import into mysql but when i try to map the excel data to mysql data datatypes are mismatch.I use the following code for my application.excel and mysql datatypes are not matched. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.OleDb; using System.IO; using MySql.Data.MySqlClient; using System.Data.Common; namespace MappingForm1 { \t public partial class Form1 : Form \t { \t\t\t int cnt = 0; \t\t\t string check; \t\t\t public Form1() \t\t\t { \t\t\t\t\t InitializeComponent(); \t\t\t } \t\t\t private void btnbrowse_Click(object sender, EventArgs e) \t\t\t { \t\t\t\t\t \t\t\t\t\t OpenFileDialog dlg = new OpenFileDialog(); \t\t\t\t\t dlg.Filter = "Excel Files (*.xls)|*.xls|(*.xlsx)|*.xlsx"; \t\t\t\t\t DialogResult dlgResult = dlg.ShowDialog(); \t\t\t\t\t if (dlgResult == DialogResult.OK) \t\t\t\t\t { \t\t\t\t\t\t\t txtpath.Text = dlg.FileName; \t\t\t\t\t } \t\t\t\t\t \t\t\t\t\t cmbExcelSheets.DataSource = GetSheetNames(txtpath.Text); \t\t\t\t\t \t\t\t\t\t\t\t //To open database fields \t\t\t\t\t\t\t string MyConString = "SERVER=localhost;UID=ascentsol;PASSWORD=ascentsol;DATABASE=ascencom_soa;"; \t\t\t\t\t\t\t MySqlConnection connection = new MySqlConnection(MyConString); \t\t\t\t\t\t\t string sqlSelect = "SELECT * from criticalityrating"; \t\t\t\t\t\t\t MySqlDataReader Reader; \t\t\t\t\t\t\t try \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t connection.Open(); \t\t\t\t\t\t\t\t\t MySqlCommand cmd = new MySqlCommand(sqlSelect, connection); \t\t\t\t\t\t\t\t\t Reader = cmd.ExecuteReader(); \t\t\t\t\t\t\t\t\t int count_column = Reader.FieldCount; \t\t\t\t\t\t\t\t\t DataGridViewComboBoxColumn combo; \t\t\t\t\t\t\t\t\t for (int k = 1; k < count_column; k++) \t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t combo = (DataGridViewComboBoxColumn)dataGridView1.Rows[0].Cells[1].OwningColumn; \t\t\t\t\t\t\t\t\t\t\t combo.Items.Add(Reader.GetName(k).ToString()); // + "\t "+"(" + Reader.GetDataTypeName(k).ToString() + ")");\t \t\t\t\t\t\t\t\t\t\t\t check = Reader.GetFieldType(k).ToString(); \t\t\t\t\t\t\t\t\t\t\t MessageBox.Show(check); \t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t\t\t connection.Close(); \t\t\t\t\t\t\t } \t\t\t\t\t\t\t catch (Exception) { } \t\t\t } \t\t\t //to fetch the excel sheets \t\t\t public static List GetSheetNames(string path) \t\t\t { \t\t\t\t\t List sheets = new List(); \t\t\t\t\t string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;""", path); \t\t\t\t\t DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); \t\t\t\t\t DbConnection connection = factory.CreateConnection(); \t\t\t\t\t connection.ConnectionString = connectionString; \t\t\t\t\t connection.Open(); \t\t\t\t\t DataTable tbl = connection.GetSchema("Tables"); \t\t\t\t\t connection.Close(); \t\t\t\t\t foreach (DataRow row in tbl.Rows) \t\t\t\t\t { \t\t\t\t\t\t\t string sheetName = (string)row["TABLE_NAME"]; \t\t\t\t\t\t\t if (sheetName.EndsWith("$")) \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t sheetName = sheetName.Substring(0, sheetName.Length - 1); \t\t\t\t\t\t\t } \t\t\t\t\t\t\t sheets.Add(sheetName); \t\t\t\t\t } \t\t\t\t\t return sheets; \t\t\t } \t\t\t private object getSheetsName(string p) \t\t\t { \t\t\t\t\t throw new NotImplementedException(); \t\t\t } \t\t\t private void btnimport_Click(object sender, EventArgs e) \t\t\t { \t\t\t\t\t //MySQL Connection \t\t\t\t\t string MyConString = "SERVER=localhost;UID=ascentsol;PASSWORD=ascentsol;DATABASE=ascencom_soa;"; \t\t\t\t\t MySqlConnection connection = new MySqlConnection(MyConString); \t\t\t\t\t string strQuery; \t\t\t\t\t //Excel Connection \t\t\t\t\t string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;""", txtpath.Text); \t\t\t\t\t string query = String.Format("select * from [{0}$]", cmbExcelSheets.SelectedItem); \t\t\t\t\t OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString); \t\t\t\t\t DataSet dt = new DataSet(); \t\t\t\t\t dataAdapter.Fill(dt); \t\t\t\t\t int cnt = dt.Tables[0].Rows.Count; \t\t\t\t\t int cntCol = dt.Tables[0].Rows.Count; \t\t\t\t\t int i, j; \t\t\t\t\t string excelField = string.Empty;\t //Hold the comma saprated string of excel field... \t\t\t\t\t string dbField = string.Empty;\t \t //Hold the comma saprated string of Database field... \t\t\t\t\t for (i = 0; i < dataGridView1.Rows.Count; i++) \t\t\t\t\t { \t\t\t\t\t\t\t if (dataGridView1.Rows[i].Cells[1].Value != null) \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t if (i != dataGridView1.Rows.Count - 1) \t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t excelField += dataGridView1.Rows[i].Cells[0].Value + ","; \t\t\t\t\t\t\t\t\t\t\t DataGridViewComboBoxColumn cmb = (DataGridViewComboBoxColumn)dataGridView1.Rows[i].Cells[1].OwningColumn; \t\t\t\t\t\t\t\t\t\t\t if (dataGridView1.Rows[i].Cells[1].Value == null) \t\t\t\t\t\t\t\t\t\t\t\t\t dbField += "NULL" + ","; \t\t\t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t\t\t\t\t dbField += dataGridView1.Rows[i].Cells[1].Value + ","; \t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t excelField += dataGridView1.Rows[i].Cells[0].Value; \t\t\t\t\t\t\t\t\t\t\t DataGridViewComboBoxColumn cmb = (DataGridViewComboBoxColumn)dataGridView1.Rows[i].Cells[1].OwningColumn; \t\t\t\t\t\t\t\t\t\t\t if (dataGridView1.Rows[i].Cells[1].Value == null) \t\t\t\t\t\t\t\t\t\t\t\t\t dbField += "NULL"; \t\t\t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t\t\t\t\t dbField += dataGridView1.Rows[i].Cells[1].Value; \t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t } \t\t\t\t\t } \t\t\t\t\t MySqlCommand myCommand = new MySqlCommand(); \t\t\t\t\t myCommand.Connection = connection; \t\t\t\t\t try \t\t\t\t\t { \t\t\t\t\t\t\t connection.Open(); \t\t\t\t\t\t\t dbField = dbField.Substring(0, dbField.Length - 1); \t\t\t\t\t\t\t //Loop on dataset to retrive row one by one... \t\t\t\t\t\t\t for (j = 1; j < dt.Tables[0].Rows.Count; j++) \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t string val = string.Empty; \t\t\t\t\t\t\t\t\t int cntb; \t\t\t\t\t\t\t\t\t for (cntb = 0; cntb < dt.Tables[0].Columns.Count; cntb++) \t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t if (dataGridView1.Rows[cntb].Cells[1].Value == null) \t\t\t\t\t\t\t\t\t\t\t\t\t continue; \t\t\t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t\t\t\t\t if (cntb != dt.Tables[0].Columns.Count - 1) \t\t\t\t\t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t val += "'" + dt.Tables[0].Rows[j][cntb].ToString() + "',"; \t\t\t\t\t\t\t\t\t\t\t\t\t }\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t val += "'" + dt.Tables[0].Rows[j][cntb].ToString() + "',"; \t\t\t\t\t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t\t\t val = val.Substring(0, val.Length - 1); \t\t\t\t\t\t\t\t\t strQuery = "INSERT INTO criticalityrating ( " + dbField + ") Values(" + val + ")"; \t\t\t\t\t\t\t\t\t myCommand.CommandText = strQuery; \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t myCommand.Parameters.Clear(); \t\t\t\t\t\t\t\t\t myCommand.Parameters.AddWithValue("dbField", val); \t\t\t\t\t\t\t\t\t myCommand.ExecuteNonQuery(); \t\t\t\t\t\t\t\t\t MessageBox.Show("SAVED"); \t\t\t\t\t\t\t } \t\t\t\t\t } \t\t\t\t\t catch (Exception) { } \t\t\t } \t\t\t private void btnCancel_Click(object sender, EventArgs e) \t\t\t { \t\t\t\t\t this.Close(); \t\t\t } \t\t\t //remove selected items from combobox \t\t\t private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) \t\t\t { \t\t\t\t\t if (cnt != 0) \t\t\t\t\t { \t\t\t\t\t\t\t ComboBox cmbCur = (ComboBox)e.Control; \t\t\t\t\t\t\t for (int i = 0; i < cnt; i++) \t\t\t\t\t\t\t\t\t cmbCur.Items.Remove(dataGridView1.Rows[i].Cells[1].Value); \t\t\t\t\t } \t\t\t\t\t cnt++; \t\t\t } \t\t\t //Get the selected ExcelSheet data from dropDownList \t\t\t private void cmbExcelSheets_SelectedIndexChanged(object sender, EventArgs e) \t\t\t { \t\t\t\t\t\t\t dataGridView1.Rows.Clear(); \t\t\t\t\t\t\t DataSet dataSet = new DataSet(); \t\t\t\t\t\t\t if (System.IO.File.Exists(txtpath.Text)) \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;""", txtpath.Text); \t\t\t\t\t\t\t\t\t string query = String.Format("select * from [{0}$]", cmbExcelSheets.SelectedItem); \t\t\t\t\t\t\t\t\t OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString); \t\t\t\t\t\t\t\t\t dataAdapter.Fill(dataSet); \t\t\t\t\t\t\t\t\t DataRow header = dataSet.Tables[0].Rows[0]; \t\t\t\t\t\t\t\t\t int cnt = dataSet.Tables[0].Columns.Count; \t\t\t\t\t\t\t\t\t int i; \t\t\t\t\t\t\t\t\t for (i = 0; i < cnt; i++) \t\t\t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t\t dataGridView1.Rows.Add(); \t\t\t\t\t\t\t\t\t\t\t dataGridView1.Rows[i].Cells[0].Value = dataSet.Tables[0].Rows[0][i].ToString(); \t\t\t\t\t\t\t\t\t } \t\t\t\t\t\t\t } \t\t\t\t\t\t\t else \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t MessageBox.Show("No File Is Selected"); \t\t\t\t\t\t\t } \t\t\t\t\t } \t\t\t } \t } please tell me the solution
VIEWS ON THIS POST

207

Posted on:

Tuesday 20th November 2012
View Replies!

cannot create stored procedure in mysql database

database : Mysql i was able to create stored procedure in localhost, once i started using live database ,, i am not able to create any procedures,. please help
VIEWS ON THIS POST

260

Posted on:

Tuesday 20th November 2012
View Replies!

Sending mail from mysql

Is there any way to send e-mail from mysql database like mssql.
VIEWS ON THIS POST

231

Posted on:

Tuesday 20th November 2012
View Replies!

parameter must be defined error on mysql with c#

the below code gives Parameter '@row' must be defined error on filling data adaptor what is wrong with my code ... best regards \t\t\t StringBuilder sql = new StringBuilder(); \t\t\t sql.Append("SET @row:=0;"); \t\t\t sql.Append("SELECT * From ("); \t\t\t sql.Append("Select @row:=@row+1 As Rec_No, _Col1, _Col2"); \t\t\t sql.Append("From _Tab1) As _T1"); \t\t\t sql.Append("WHERE Rec_No > 1 And Rec_No
VIEWS ON THIS POST

721

Posted on:

Tuesday 20th November 2012
View Replies!

loop in mysql

i have one table banc_premium in which each app have more then 1 trounches few of them are paid for example 3 premiums are paid and three premium are due so have to print trounche number fouth,five and six it is working for single application but not working for multiple application kindly help me. The Procedure is CREATE PROCEDURE sp_repeat3(IN applicationnumber1 VARCHAR(100),OUT appnum VARCHAR(100)) BEGIN --Declare appnum int; select distinct applicationnumber into appnum from banc_premium where applicationnumber=applicationnumber1; select @rownum:=@rownum+1 Tronch,paymentdatetime,applicationnumber from banc_premium a, (SELECT @rownum:=(select count(*) from banc_premium where applicationnumber=appnum and paymentdatetime
VIEWS ON THIS POST

185

Posted on:

Tuesday 20th November 2012
View Replies!