You, Sir, are a very good man. I forgot totally about calling the ReadXml method, saves me from having to turn everything into an XSD and can simply populate the crystal report using it instead. Bob for President.
scotlandc
Posts
-
Activator.CreateInstance -
Activator.CreateInstanceThanks for the answers guys, much appreciated. Just one more thing, is there a way I can instantiate a custom dataset on the fly as well. Similar to the crystal reports, I've another folder which contains XSDs to use as the datasources for the reports. Could they also be generated according to user input? Thanks again for your help so far.
-
Activator.CreateInstanceHello. Am not sure about this, hope someone can provide a little help. I've got a folder with a variety of pre-defined Crystal Reports which will need to be instantiated depending on some user input. This folder is not part of the solution, it's just sitting on a server drive. So assuming the input is rptTest, I need to instantiate the report called rptTest. If the app can't find a match, it alerts the user. Is it Activator.CreateInstance I need to accomplish this or is it simply not possible? If it is, can anyone provide a code sample. I know I need an assemblyname and a typename for one but which would be the user input and what would the other be? Hope I'm being clear and that someone can help. Thanks in advance
-
Visual Studio Command Prompt - Xsd.exeHi all, Am using the xsd command under the VS2005 command prompt to turn an XML dataset into an XSD schema for use in an application, for example, c:\>xsd dsExample.xml which creates a file called, unsurprisingly, dsExample.xsd. However, when I add dsExample.xsd to my solution, under its properties the name property is NewDataSet. Is there a command line argument or option that I am missing that will set the name property to dsExample so that I don't have to rename it manually in VS2005? Thanks Scott
-
C# Windows ServiceHi all, Thanks very much for the suggestions so far. Will implement those changes now, hopefully that will sort this last bug out. Much obliged to you all, Scott
-
C# Windows ServiceI am indeed using FileSystemWatcher to monitor the folder but I admit I was unaware of any deficiencies in it. Can you explain a little what they are please?
-
C# Windows ServiceHi, Have written a small Windows service which monitors a single folder waiting for simple text files to arrive in said folder. Once a file or files arrive, the service converts them to XML, deletes the file(s) from the 'in' folder, copies it to an 'out' folder where another process deals with them. It's a simple, clean service which runs fine 99% of the time. However, the other 1% of the time, a file or files arrives in the 'in' folder and nothing happens. The service doesn't seem to have noticed that anything has arrived in the folder it's watching. Does anyone know of any reason why the service would stall every so often. It's a very small problem but one that I'd like to iron out if I can.... Thanks in advance Scott
-
Isolation LevelsHi, Am trying to update a database, setting a datetime value to the value set on a datetimepicker, and every time I try it, I get the following error message ERROR[HY000][DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Statement not allowed in readonly isolation level (7671) Is it possible to override this isolation level, and if so, please can someone point me in the right direction of how? With thanks in advance Scott
-
Hidden Query StringThanks for that, didn't know you could do that. Will that also grant access to the query string as well? Will need to see it to extract the parameter names from the query string?
-
Hidden Query StringHi all, Is it possible to get access to a query string when its hidden from view? Google's query string would be easy to do as you can capture the value of 'q' from the string, change it then set it away searching as its visible. It doesn't matter to the application that the user can't see (or does not need to see) the query string but how can I capture it, manipulate it behind the scenes than pass it to be processed? Cheers Scott
-
Publishing a Website with VS2005Hi all, Have created and published a website which has then been installed to a virtual directory using IIS. However, when I try to get access to the default.aspx page through IE, I get a 'page not found' error. Its the same for every page which was included in the site, there are only 3. I created a test.txt file in the same directory as the website after installing through IIS, and I can get access to this through IE using the website's IP. Nothing appears through localhost, not any of the web pages nor test.txt. I can't even get a directory content listing to display. Anyone know what I've forgotten to do and would like to tell me please? Thanks in advance. Scott
-
C# Image PrintingHeh, unlike a lot of things in the world of computing, that actually makes sense. Am annoyed at myself now for not thinking of that. Thank you very much.
-
C# Image PrintingHello everyone. Hope someone can help me here. I've built a basic image printer and I need to add a small 2-line table to every page that it prints. Any ideas on how to accomplish this? I can provide code samples if necessary. Thanks in advance. Scott
-
Newbie Problems...Hi all, Am trying to call a simple function held against an Oracle database. I've included the function at the bottom of this post. All it does is return a varchar(3) value along the lines of 'ROW' or 'ENG', depending on what value was passed in so one IN parameter and one OUT. The C# code used to call this is as follows: OracleCommand cmd = new OracleCommand("SMD2EUP.get_lan_id", con); cmd.CommandType = CommandType.StoredProcedure; OracleParameter cv_Ref = new OracleParameter("cv_ref", OracleType.Number, 5); cv_Ref.Value = item.CV.Ref; cv_Ref.Direction = ParameterDirection.Input; OracleParameter lan_ID = new OracleParameter("this_lan_id", OracleType.VarChar, 3); lan_ID.Direction = ParameterDirection.Output; cmd.Parameters.Add(cv_Ref); cmd.Parameters.Add(lan_ID); cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); string result = cmd.Parameters["this_lan_id"].Value.ToString(); The SMD2eup is the name of the package that the function is stored in and get_lan_id is the name of the function. All code compiles successfully. When I run the application I get ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_LAN_ID' What am I missing as I can't see anything wrong with the code, 1 IN paramter of type Number (or int) and 1 OUT parameter of type VARCHAR(3) (or string) with the directions being declared. Please can some one help? Thanks very much... FUNCTION get_lan_id(cv_ref eup_comm_veh.xvol_region_ref%TYPE) RETURN eup_comm_veh.lan_id%TYPE IS this_lan_id eup_comm_veh.lan_id%TYPE; BEGIN SELECT lan_id INTO this_lan_id FROM eup_comm_veh WHERE cvh_id IN (SELECT MIN(cvh_id) FROM eup_comm_veh WHERE xvol_region_ref = cv_ref); RETURN(this_lan_id); EXCEPTION WHEN NO_DATA_FOUND THEN this_lan_id := LAN_ERROR; RETURN(this_lan_id); WHEN OTHERS THEN this_lan_id := LAN_ERROR; RETURN(this_lan_id); END get_lan_id;
-
Sorting a ListView by more than one columnHello, Hope someone can help with this, I've built a collection which I'm then using to populate a ListView. I need to somehow be able to sort the ListView by 2 columns, column indexes 3 then 2. The ListView contains information about advertisements in a publication and I need to be able to sort by section (column 4, idx 3) then page no (column 3, idx 2). The thing is, how? I know I need to use the ListViewItemSorter method somehow but I've no idea how to attach the required columns. It will only ever be these 2 columns and they will always have the same position in the ListView (idxs 3 & 2). Hope someone has a work around for this, I've managed to do it in a DataTable but can not get it working here yet. If anyone has a different solution to this problem, please don't be shy. I'm more than open to new ideas. Thanks in advance everyone, Scott
-
File LockingHi Le Centriste, Thanks very much for the suggestion but the way the DBA here controls his database borders on the psychotic. By the time he considers the request and then (if?) actually actions it, I'd hope to be able to achieve the same thing programatically... Any more ideas anyone? Scotty
-
File LockingHi everyone, I need to know how I can lock a file if someone else is using it. Briefly, I have an application which allows users to view pieces of mpg (each has a unique ID) and attach relevant data to it - a translation if needed, brand/product info etc - and then saves the whole item (mpg + metadata) to a database including the path to the now-archived mpg. The mpgs are played by clicking the appropriate row in a datagrid control which launches the mpg in a form with a media player control embedded into it. The thing is, I need to be able to somehow lock an mpg so that if user A is busy with it then user B can not begin work on it at the same time. All of the mpgs are stored on a central holding server which may have up to 20 people connected to it at any one time. When a user goes to enter the mpg information, the initial media player window closes and transfers them to a data entry screen. This holds the unique name in view but its only existent on the form at this point, not on a database. Can this be done? Sorry if I waffled, just wanted to give as much info as possible. Cheers everyone Scott
-
Returning valuesHi, I hope someone can help. I have to import some data from a text file into a database. The text files are loaded into a datagrid to be previewed and validated before being imported. There are some conditions to the import, each child record must have a pre-existing parent record before it will be imported etc. The validation is handled in a stored procedure. What I need to do is return all of the values that have failed to import in a collection. public ItemEventCollection failures = null; ... public ItemEventCollection EventImport(SecurityContext sc, ItemEventCollection EventCollection) { if (EventCollection != null) { foreach (ItemEvent itemEvent in EventCollection) { try { ItemEventInsertCommand.Execute(DataAccessManager(sc), itemEvent); } catch { failures.Add(ItemEvent); } } } return failures; } If I step through the code, failures always has a count of 0 when I know there are rows failing the import conditions. I need to add them to failures then pass it back to a datagrid. How? Do I use the out keyword or simply return the ItemEventCollection, I'm really stumped on this one, please can someone help? Best regards Scott ;)
-
FileMode.Create?Hi, I've got to import a collection of text files into a database, the collection being anywhere between 3 and 20 files in size. A typical collection would look like 1 x AD?????????.txt 1 x LB?????????.txt ? x PL?????????.txt There can be anywhere between 1 and 20 PL files at any one time. I'm wondering on what the best way is to deal with the files with multiple versions, ie the PL files. Is it better to create a new file and append all of the text from the PL files into it before import? If so, how? I know there is a FileMode.Create method but am unsure as how to use it. Any tips on this or suggestions on a better approach would be greatly welcomed. Thanks a lot Scott
-
Looping through a datagridHi, I know its last thing on a Friday but I hope someone can help. I need to loop through every cell in a datagridview and make sure that each value is not null. Looping through the cells isn't a problem (I don't think), I used a for loop with another nested inside, the inner loop taking care of the column index and the outer loop holding the row index. What I can't do is check the contents of each cell as there is no suitable method in DataGridCell. Please can anyone help? Thanks Scott The loop code used if anyone is interested. for (int i = 0; i <= rowCount; i++) { for (int j = 0; j <= colCount; j++) { DataGridCell dgc = new DataGridCell(i, j); } } Scott