Asp.net with MYSQL DATABASE


Hi , i have one my sql database. what typoes of name space , conection string and anything. is use in our asp.ner with c# application..
plz help me

Posted On: Tuesday 20th of November 2012 04:23:38 AM Total Views:  378
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




Problem with select data. Help!

I try to select data from my database where i will pull the data based on latest time and group by name. below are the sample data: ID Name Starttime Endtime 1 AAA 1/5/2012 8.00am 1/5/2012 10.00a.m 2 BBB 2/5/2012 9.00a.m 3 CCC 2/5/2012 10.00a.m 2/5/2012 3.00pm 4 AAA 2/5/2012 10.00a.m selectID,Name,Max(Start_Time),End_TimefromchambergroupbyName System will return me data as below: ID Name Starttime Endtime 2 BBB 2/5/2012 9.00a.m 3 CCC 2/5/2012 10.00a.m 2/5/2012 3.00pm 4 AAA 2/5/2012 10.00a.m 1/5/2012 10.00a.m System will automatic replace the empty value on End_Time on 'AAA' Can someone help me to fix the error.
VIEWS ON THIS POST

121

Posted on:

Tuesday 20th November 2012
View Replies!

Adding a duration to SQL query accessing an IBM iSeries server with DB2 - exception SQL0187

I'm building a sqlquery in the code behind of an aspx page and loading the query into a session variable. The next aspx page presented has some code behind that accesses the session variable and makes it the SelectCommand for a SqlDataSource loading a GridView. Bit cumbersome but that part works. Problem is with the sql statement failing, throwing exception... SQL0187: Use of labeled duration not valid. Cause . . . . . :\t One of the following has occurred: -- A labeled duration is specified but is not the operand of the operators plus or minus. -- A labeled duration of years, months, or days is specified as the operand of addition or subtraction and the other operand is not date or timestamp. -- A labeled duration of hours, minutes, or seconds is specified as the operand of addition or subtraction and the other operand is not time or timestamp. -- A labeled duration of microseconds is specified as the operand of addition or subtraction and the other operand is not timestamp. -- A labeled duration is specified as the left operand of subtraction. -- The value specified for the labeled duration is not a numeric type. Recovery . . . :\t Correct the use of the labeled duration. Try the request again. ...the substitution of the session variable into the query looks like thisin the code... ...where t2.sordte>=('" + Session("StartDate") + "' + 3 DAYS) and... ...the failure being on the corresponding bit of the query that when the string is interpreted looks like (from the debug viewer)... ...where t2.sordte>=('04/20/2012' + 3 DAYS) and ... ...which I know is the failure point because when I change the code to makeit be... ...where t2.sordte>='04/20/2012' and ... ...the query works. Can someone show me what the correct syntax should be\t Or if I'm just doing it wrong show me how it should be done\t I think it has something to do with the DB2 syntax there being no addduration.
VIEWS ON THIS POST

302

Posted on:

Tuesday 20th November 2012
View Replies!

OCIEnvCreate failed with return code -1

Hi: I'm using VS 2005, Oracle 11g and Application Server is VS2008. I've updated oracle clinet in the server since then getting error: OCIEnvCreate failed with return code -1; when try to pull data from oracle. Please help me.
VIEWS ON THIS POST

463

Posted on:

Tuesday 20th November 2012
View Replies!

I have a question on how to setup a table for use with a TreeView

I have never had to set one up so I don't know how the layout should be done in order to know what goes with what node in the TreeView. I figured someone out here has done this with as many hits as the site gets. BTW,
VIEWS ON THIS POST

183

Posted on:

Tuesday 20th November 2012
View Replies!

The provider is not compatible with the version of Oracle client

I am having the error stated above. The stack trace is as follows: [OracleException:TheproviderisnotcompatiblewiththeversionofOracleclient] Oracle.DataAccess.Client.OracleInit.Initialize()+550 Oracle.DataAccess.Client.OracleConnection..cctor()+518 [TypeInitializationException:Thetypeinitializerfor'Oracle.DataAccess.Client.OracleConnection'threwanexception.] Oracle.DataAccess.Client.OracleConnection..ctor()+51 InputForm.SelectRegion()+123 InputForm.Initialize()+952 InputForm.Page_Load(Objectsender,EventArgse)+53 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtrfp,Objecto,Objectt,EventArgse)+25 System.Web.UI.Control.LoadRecursive()+71 System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+3048 Some info's: Server: Windows Server 2008 R2 .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 Oracle.DataAccess, Version=1.102.3.0 Dev Computer: Windows Vista Business 32bit .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 Oracle.DataAccess, Version=1.102.3.0 My Code: OracleConnection cn; String con1 = ConfigurationManager.ConnectionStrings["myConnectionString"].ToString(); cn = new OracleConnection(); cn.ConnectionString = con1; cn.Open(); string mysql = "select region_code, 'Region ' || reg_rom " + \t\t\t\t\t\t\t "as region_name from pro_lib " + \t\t\t\t\t\t\t "where reg_rom is not NULL " + \t\t\t\t\t\t\t "order by sort_order"; OracleCommand cmd = new OracleCommand(mysql, cn); cmd.CommandType = CommandType.Text; I have checked all forums and posts regarding this error. They mention that there are 2versions of Oracle.DataAccess.Client on the server, I only have 1 version. This runs on VS2010, but when I publish the website the error above shows up. I checked my Oracle connection from the installer and connection test passed. I tried uninstalling Oracle and reinstall, but still the same. The query above I tried changing to 'select region_code, reg_rom, ...', still the same error... please HELP ME!!!
VIEWS ON THIS POST

1274

Posted on:

Tuesday 20th November 2012
View Replies!

craete excel workbook with diffrent sheets and send it as attachment using memory stream

hi, We are sending auto email of different reports to our client everyday in PDF with seprate email for each report..... But Now client wants all report should come in one Excel workbook with diffrent sheets containing diffrent report ... we are using memorystream to send email.... how to craete excel workbook with diffrent sheets and send it as attachment using memory stream ......
VIEWS ON THIS POST

254

Posted on:

Tuesday 20th November 2012
View Replies!

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.

I have a vs2008 web application. it built fine and it was runing fine use visual studio development server, but when i use IIS web server, it gave me the following error, Can you anybody help with that
VIEWS ON THIS POST

356

Posted on:

Tuesday 20th November 2012
View Replies!

MySQL integration with ASP.NET4......

Currently i am using MS-SQL Express..... Now my client asked me to use MySQL instead of MS-SQL. Can anyone help me how to connect and integration with My-SQL and i have no knowledge about My-SQL........ Thank You.
VIEWS ON THIS POST

192

Posted on:

Tuesday 20th November 2012
View Replies!

portable database with .asp.net 4.0

I want to architect asp.net application is such a way that it could handle any database(mysql, sqlserver, access etc). Can some one explain me complete architecture of application with database layers so I only change database server in configuration and the Data Access work with any database. I want to use asp.net 4.0. please explain complete strategy.
VIEWS ON THIS POST

254

Posted on:

Tuesday 20th November 2012
View Replies!

Com object Excel throwing error- Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

I am getting the folloing error when i created was writing values to an excel. It runs on local mahcine but in server it is throwing error as follows. Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a. I tried giving permission for Dcom objects in component services following this link http://blog.crowe.co.nz/archive/2006/03/02/589.aspx . but still having issues. before giving acces i was gettingno disk space error for writing com object. Anyway, not working. Please guide.
VIEWS ON THIS POST

346

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

653

Posted on:

Tuesday 20th November 2012
View Replies!

How to connect postgresql database with asp.net

Hi , I have a problem with the connection with postgresql. I m using ms sql but I want to use postgresql. As I search, to use postgresal we need to add Npgsql to project. I downloaded it and added to project but it does not work. Can anyone have an idea about it and help me
VIEWS ON THIS POST

240

Posted on:

Tuesday 20th November 2012
View Replies!

.NET with Oracle 11 and Server 2008

Does anyone have a good guide for getting a .NET app to work with an Oracle 11 database onWindows Server 2008\t\tI have an app built by someone else I'm trying to get working on a different server.... I would've gladly used MS SQL....\t Better yet, does anyone think it would be easier to convert the app to work with MS SQL\t It'sa simple and small database. It only has 4 tables.
VIEWS ON THIS POST

223

Posted on:

Tuesday 20th November 2012
View Replies!

Custom paging with mysql

I want to do custom paging in gridview with mysql database. can anyone have store procedure to do custom paging using object datasource.
VIEWS ON THIS POST

199

Posted on:

Tuesday 20th November 2012
View Replies!

Connection pooling issue with microsoft enterprise library in mysql

I am using microsoft enterprise libarary to connect to mysql using mysql .net connector (latest version 6.2.3) But i am facing a problem of too many connections and connection pool reached maximum limit issue. As connection is disposed by enterprise library iteself so i dont close the connection anywhere. So after two or three hours i found i have 100 mysql connections in sleep mode which are doing nothing and are not being reused from the code . So i want to ask is there any issue with my code or is there any issue with mysql connector please suggest me a solution so that i can rectify this issue as it is causing a lot of trouble to me.
VIEWS ON THIS POST

223

Posted on:

Tuesday 20th November 2012
View Replies!

Import from csv to SQL with >255 columns

Hi Guys, Beentrawling the various SQL posts on here but haven't found anyone with the same issue as me, whcih is as follows: I'm writing a reporting toolthat, as a starting point, needs to create a DB table from a csv file. This csv file will have been created from exporting data from our old system (with the new system being the reporting tool) and can have up to 300 columns of data. I've been trying as follows: temptable=DBtabletobecreated strDomain=pathtocsvfile strFileName=thecsvfilename but am finding that only the first 255 columns get put in. I am assumg that the Jet driver is the one that is limiting the columns, or is there a registry setting somewhere that'll solve it quickly Is there another approach that'll work\t I've though of the following, but as it'll take a while to recode and test each time I thought I'd ask the experts first!! BULK INSERT: would mean that I'd need to pre-create the table first, but if the issue is with the Jet driver I'd surely get the same problem Use a datatable: it seems pretty fiddly and probably a lot slower, but I guess I could read into a dataset and then bind that to a table to insert\t Again the table would need to exist and the driver that I use to read from the csv would be the issue Do it one row at a time in a loop in the code: assuming I can read the file as text, I could then split the data in code into an array and create a insert statement (again to an existing table) for each row. With what could be 1000s of rows I can't imagine that this is the fastest solution! Any top tips on what is causing the limit, how I cna overcome it or alternative solutions would be greatly appreciated! Thx.
VIEWS ON THIS POST

135

Posted on:

Tuesday 20th November 2012
View Replies!

employee attendance with in/out times (was "Query Help Needed...")

Dear Friends, I am in problem & have to solve one query. I have a one table with the empno, employee time in & time out, data, employee can go out & come in fequently in a day. I want to know that how much time every emp have attend in the company per day. I want to know that how much time every emp have not attend in the company per day(once he enter at morning and he come out in the end of the day) Kindly, do reply as soon as possible. I am enclosing data defination in txt file along with the data in the MS Excel file. Thanx in Advance... SuraReddy, Emani The Table Like this Create table emptime ( EMPCODE VARCHAR2(5), CARDNO VARCHAR2(5), EMP_CODE_NAME VARCHAR2(25), INOUTTIME TIMESTAMP(6),\t\t\t\t\t\t\t IOGATENO VARCHAR2(10),\t\t\t\t\t\t\t DOOR VARCHAR2(20),\t\t\t\t\t\t\t IN_OUT VARCHAR2(10)\t\t\t\t\t\t\t CARDDATE DTE );\t\t\t\t\t\t\t\t\t\t\t Note: INOUTTIME this will only time like 03:45Am, 15:30PM CARDDATE this will only Dae like 25-09-2010
VIEWS ON THIS POST

295

Posted on:

Tuesday 20th November 2012
View Replies!

Need help with uploading a text file in to mysql database

I want to upload a text file and stored to my database. the column on mydatabaseit is longblob type. I don't know much about this so if anyone can help I will
VIEWS ON THIS POST

369

Posted on:

Tuesday 20th November 2012
View Replies!

Customizing a gridview with data from an oracle DATABASE

hey , i have dates stored in an Oracle DB , each date is related to an ID DATE IDENTIFIER 12/3/2010 34 11/3/2010 32 .... i have a grid view that contains all the identifiers ( with other informations) but now i'm stucked because , i need to hilight each row that contains and id having an occurence in the first table (with the condition that the referenced date should be in a specific interval (first and last day of the previous month )) !!!! for example ID INFO1 INFO 2 ..... 34 III IIII ..... this row has to be highlited! can you please help me\t\t thanks i've done this protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) \t { \t string connectionString = "DATA SOURCE=;PERSIST SECURITY INFO=True;USER ID=scott;PASSWORD=mimo0205"; \t OracleConnection oracleConnection = new OracleConnection(connectionString); \t oracleConnection.Open( ); \t \t \t DateTime deb = Convert.ToDateTime(DateTime.UtcNow.AddDays(-DateTime.UtcNow.Day).AddMonths(-1)); \t DateTime fin = Convert.ToDateTime(DateTime.UtcNow.AddDays(-DateTime.UtcNow.Day+1).ToShortDateString()+" 00:00:00"); \t \t Label8.Text = deb.ToString(); \t Label9.Text = fin.ToString(); \t \t \t OracleCommand oracleCommand5 = new OracleCommand(); \t oracleCommand5.CommandText = String.Format("SELECT DATEENVOI from validationRPV where code_ag='" + e.Row.Cells[1].Text + "'"); \t oracleCommand5.Connection = oracleConnection; \t \t \t int i = 0; \t \t OracleDataReader oracleDataReader4 = oracleCommand5.ExecuteReader(); \t //i = oracleDataReader4. \t ////affichage des entretiens individuels \t while (oracleDataReader4.Read()) \t { \t \t \t DateTime dateRecup = Convert.ToDateTime(oracleDataReader4["DATEENVOI"]); \t if ( (dateRecup >= deb) & (dateRecup = deb) & (dateRecup
VIEWS ON THIS POST

189

Posted on:

Tuesday 20th November 2012
View Replies!

How to do dropdownlist search in asp.net with C# with mysql ?

I got table name ( customer ) and field Name as ( customerId , companyName , personName and poscode ) in Mysql Now i have created search function by using textbox (txtCompanyName.Text) like where i can query companyName by entering data to textbox to search . Coding :- qry = "select * from customer where companyName='" + txtCompanyName.Text + "'"; Bt i want to do search by using1 dropdownlist(companyName , personName, poscode).For example i selectdropdownlist as companyName andenter thename in textbox and search. After that i select the same dropdownlist with personName field and enter the name of the person and search . How to do that and what is the mysql query for such case Please help .
VIEWS ON THIS POST

204

Posted on:

Tuesday 20th November 2012
View Replies!