I didn't. This particular issue falls under two topics, it may well be an ADO.NET issue, or a C Sharp issue, so hence my post in both forums. Paul
oceanexplorer
Posts
-
Help - "Could not find installable ISAM" -
Help - Could not find installable ISAMHi, I'm currently working on a project to read in an excel file and display it using a DataGrid. However every time I try to open the connection I get the error - Could not find installable ISAM. I have Office 2007 installed and have also installed the Access Data Acces components. This is the current code that opens the connection
OleDbConnection cnCSV = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\test.xlsx;Extended Properties=Excel 12.0;HDR=NO"); cnCSV.Open();
Does anyone know a work around for the ISAM? Do I need to re-install MDAC? Paul -
Help - "Could not find installable ISAM"Hi, I'm currently working on a project to read in an excel file and display it using a DataGrid. However every time I try to open the connection I get the error - Could not find installable ISAM. I have Office 2007 installed and have also installed the Access Data Acces components. This is the current code that opens the connection OleDbConnection cnCSV = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\test.xlsx;Extended Properties=Excel 12.0;HDR=NO"); cnCSV.Open(); Does anyone know a work around for the ISAM? Do I need to re-install MDAC? Paul
-
Accessing control from seperate classThanks Mike, It's friday, I'm bored of thinking and want to go home!! In order to gain access to the object, I tired making it public rather than private but I still cannot see it, public static allows me to see it but then that causes hassle in construction and it won't build. I would normally create public property accessors but I need access to the object in order to invoke methods. Any ideas? Thanks again Paul
-
Threading and cross-threadingCan anyone still answer this?
-
Accessing control from seperate classYep I know I'm having a dumb blonde moment! To be honest I know about accesing controls from other classes etc. But my difficulty with this one is I am dealing with threading, I have a UI that runs on one thread, when a button is pressed, it creates a new thread and goes of and executes another (labour intensive task), within the running task I want to make callbacks to the UI to update a listbox with messages. I have setup the delegates fine but my trouble is in accessing the listbox control to call the begininvoke method e.g. lstLogger.BeginInvoke(delegate, object) To call this from the other class I would need to create a new instance of the Logger class which contains the listbox lstLogger, but I don't want to do this, I want to invoke a method on a seperate thread that is already running. It's driving me nuts, all the examples I can find do it from within the same class, which is easy to set up as I have access to the lstLogger control. Hope that explains a bit more and doens't make me sound so dumb! Regards Paul
-
Accessing control from seperate classHi, I need to call an invoke method on a list box called lstLogger, e.g. lstLogger.BeginInvoke(delegate, object) However that would be fine if I was in the same class as the lstLogger, but I'm in a seperate class. How can I access lstLogger in order to call the BeginInvoke method? Regards Paul
-
Threading and cross-threadingHey Daniel, thanks for a great response, that makes it a lot clearer for me, I was having major mental block! I have just one further question, what is the best way for me to access the lstLogger control from a seperate class? I tried changing the control to public static but the obviously is incorrect. I could in the migration class create a new instance of the Logger class and call it- Logger log = new Logger(); log.lstLogger.BeginInvoke(delegate, objects) But that won't work properly, what are you thoughts? Thanks again Paul
-
Threading and cross-threadingHi, I have created a windows form the contains a button and a list box. When the button is clicked it fires the following code,
Migration.Begin(); thread = new Thread(new ThreadStart(Migration.Begin)); thread.Start();
Migration is a seperate class that is executed on a new thread as it will be a labour intensive task and I want the UI to remain usable. However within the migration module I want to be able to call back to the thread that created the UI and have it append a message to the listbox. So intially in the UI class I added a delgate which called a seperate function to add a line to the listbox:public static LoggerListDelegate loggerListDelegate; public Logger() { InitializeComponent(); loggerListDelegate = new LoggerListDelegate(AddLine); }
And the function addline was as follows:public void AddLine(string line) { lstLogger.Items.Add(DateTime.Now.ToLongTimeString() + ": " + line); }
I then called this from the Migration using the following:Logger.loggerListDelegate.BeginInvoke("******Migration has begun******",null,null);
This however is giving me an issue that it is not thread safe as I am trying to invoke on different thread the list was created on. So my understanding is that I would really need to call the Listbox invoke method, e.g. lstLogger.Invoke(delegate, objects) If that's correct how do I access the lstLogger from my Migration class in order to invoke it? If this is not right how do I go about making it threadsafe? Many many many thanks Paul -
asp dot net - session stateHi, You may want to look more into using a datareader for this type of usuage if your wanting to cycle through a record at a time. An SqlDataReader sits in the System.Data.SqlClient namespace. You call a read by something like this (this isn't perfect code as I work in c#!) SqlConnectionconnection = newSqlConnection("myconnectionstringhere") Dim command As SqlCommand = newSqlCommand("SELECT * FROM Customers", connection) connection.Open() Dim data As SqlDataReader = command.ExecuteReader() data.read() The Data.Read method will advance and retrieve the next record. Remember to close the connection once your done with it. Do a search on google for SqlDateReader and you will get information on it's usage back. Regards Paul
-
Access to file deniedHi, I'm currently working between two technologies, classic asp and ASP.NET. A file is uploaded to a folder using the classic asp, the asp.net then tries to access this file later on, but I am receiving an "Access denied message" to the file. I know that this is because the file does not have the ASPNET user account added to the security permssions. I have added the ASPNET user to the folder the file is stored in, and set that any new files inherit the permissions of the parent. Now this works for all the user accounts but the ASPNET user, it just refuses to add the security permission. Is there an easy way to solve this, or perhaps add a user permission to the file progrmamtically? Any help much appreciated Paul Custance
-
How do I write XML into XMLDocument?Hi, I am currently returning an XmlDocument from a webservice using the following:
[OperationContract] [FaultContract(typeof(Anaqua.Domain.AnaquaServiceError))] [XmlSerializerFormat] public XmlDocument GetLawUpdateGenerationXML(short versionNum) { ///Code here to gets the xml from the db }
Then in my page that consumes the webservice I did the following:XmlDocument doc = (XmlDocument)svc.GetLawUpdateGenerationXML(internalVersionNumber);
However it is saying: Cannot convert type 'System.Xml.XmlElement' to 'System.Xml.XmlDocument' Now I think this is because of the serialization using[XmlSerializerFormat] So how would I go about reading the XML into and XML Document? Regards Paul Custance -
Binding GridView to a child obect in a listHi, I have a strongly typed list that contains a collection of objects, which I can bind to, however I also need to be able to bind to a child object contained in the list, and bind it the gridview. Does anyone know how to do this? Regards Paul Custance
-
resize iframe nested in a pageOk I answered my own question, but for those who would like to know the solution: I called the function by "parent.parent.resize('iFrameId')" The parent.parent called the function in my classic asp page that holds the iframe. I then added the call to the OnResize event of the html tag on my aspx page. Hope that helps Paul C
-
resize iframe nested in a pageHi, I currently have an iframe sat on a classin asp page, this iframe then displays my aspx pages as we are in the process of migration to .net framework. Currently in the classic asp page I have a javascript function that is called using the iframe onload function, this resizes the iframe according to the size of the content loaded in. It works a treat. However my issue is how can I call that function again from within in my aspx page, say if the page grows dynamically (i.e. options or validation messages are added). Currently the content gets pushed out the iframe, so I would need to call the resize function again. Any ideas would be greatly appreciated. Regards Paul Custance
-
Is it possible to create groups in session?Thanks for your help, much appreciated. I have decided to implement a Dictionary in order to create groups in session. Regards Paul
-
Is it possible to create groups in session?Hi, I was wondering is there a way to create groups in session. so that if I needed to clear down session variables pertaining to a particualr section of our application, I could call Sesswion.Clear on that group, but leave all others intact? Regards Paul Custance
-
Selected index opf dropdown within a repeater always returns 0OK, I truly hang my head in shame, how could I miss something so obvious! Think I couldn't see the wood for the trees, so to speak! Thanks Christian, worked a treat and thanks for such a prompt response :) Paul
-
Selected index opf dropdown within a repeater always returns 0Hi, I currently have a repeater that renders a series of dropdowns depending on data returned from the database. When the user clicks next on the screen I want to cycle through the dropdowns in the repeater and stored the selectedindex of each into an array that will then be stored in session. So that if the user returns the values they selected will persist. The code I have is a follows:
int[] intArray = new int[RemapRepeater.Items.Count]; DropDownList reMapDropDown = new DropDownList(); for (int i=1; i <= RemapRepeater.Items.Count; i++) { reMapDropDown = (DropDownList)RemapRepeater.Controls[i].FindControl("reMapDropDown"); intArray[i] = reMapDropDown.SelectedIndex; }
However every dropdown returns a selected value of 0, as if it's picking up the values of the page when it was first rendered and not the values that have been selected. Has anyone any ideas where I might be going wrong? Regards Paul Custance -
iframe auto resizeOk I stand corrected :) Thanks for all your help, not had chance to try the cross frame scripting as have been away for a few days. Regards Paul