Answer Questions
Master Programmer Getting wrong path from Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location
Hi I am getting wrong location for my file. My file is at different loaction but "Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location" always returning "C:\Windows\System32" path. But it runs ok on other machines. What could be the reason for getting system32 path instead of actual file path. The file is running as windows service. Thanks SAnjivani Bit of a long shot, but services are hosted by c:\windows\system32\svchost.exe... Hi, As you said, it runs ok on other machines, then are you sure that on other machines it is being used same way in Windows Service Because AFAIK, windows service will return this path only, so use AppDomain.Curr ...Show All
Claudia Alvarado displaying hexadecimal values with leading zeroes?
Hi, I wish to write to a file some Integers in hex format. That is, if the Integer contains ten, I'd like to write A. Actually, I'd like to have some leading zeroes included...000A instead of just plain A. theInteger = 10; sw.Write(theInteger.ToString( "x" )) // displays 'a' How can I force some number of leading zeroes I've looked at Help, but confess to getting lost in too many layers of IFormatter, GetFormat, etc. Steve Uh, embarassingly easy. Thanks! Steve Easy, just add the total number of digits you want after x sw.Write(theInteger.ToString("X4")); ...Show All
nilaavu SqlDataAdapter
Microsoft documentation for DbDataAdapter.Update Method (DataRow[], DataTableMapping) says: When using Update , the order of execution is as follows: The values in the DataRow are moved to the parameter values. The OnRowUpdating event is raised. The command executes. If the command is set to FirstReturnedRecord , then the first returned result is placed in the DataRow . If there are output parameters, they are placed in the DataRow . The OnRowUpdated event is raised. AcceptChanges is called. Does Microsoft implementation of this method call AcceptChanges after step 3 if the row to be updated is DataRowState.Added (a new row) This can be easily verified using an RowUpdated even ...Show All
Josh_G Generate a Class from an XML file
I have a challenging idea that hopefully someone has some ideas on how to solve... Does anybody have any ideas on how to go about creating a .NET class whose sole purpose will be to read in an XML file and, based on the data contained within the XML file, from it will be able to dynamically create a class I'm not talking about an object of the class, because obviously there's many options to do that. I'm talking about creating the entire class and everything in the class; the name of the class, modifiers, members, methods, properties, etc. I'm not concerned about logic/decision making inside the class, nor am I concerned about events, delegates, threads, and other advanced topics, just the basics that I mentioned. I ...Show All
nattylife how do I get current system time
In vb I can get system time call time() function. But how I can get it in C# DateTime class has a shared property called Now that returns the current DateTime. DateTime today = DateTime.Now; Thank you. It's my first intercourse with foreigner. ...Show All
cheston howto converting millimeter to inch and viceversa?
Hi Community! Is there some built in functionallity in the framework, to convert millimeter to inch and viceversa especially I must be able to convert the millimeters to inch with fraction format like: 3,175 mm -> 1/8 " Background: My application is internally based on datatables holding collums with metric lengths, but the customer is used to inch and doesn't want to see mm :-( Therefore I must display all lengths in inch (fraction format). Also they must be editable in inch (fraction formatted). What would be the easiest way to get that done Thanks for help and hints Rainer Queck Is your problem solved Please mark the thread as answered if it is.... Try this: Im ...Show All
Mauricio Castillo E difficulty accessing Excel spreadsheet via ODBC
trying to access a spreadsheet on a network share. ODBC connection string: "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;DefaultDir=\\sdi-fs2\Bypass\4ANAMEDONOTDELETE;DBQ=\\\sdi-fs2\Bypass\4ANAMEDONOTDELETE\0e89da37-180c-4214-af37-632cce8dc476.xls" Produces the following error: ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x7b4 Thread 0xabc DBC 0x348274 Excel'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x7b4 Thread 0xabc DBC 0x348274 Excel'. ERROR [HY000] [Microsoft][ ...Show All
Malmer DataAdaptor Update() method
Hello, I am facing a problem regard updating data back from a dataset to my data store using SqlDataAdapter. first i wished to perform updates from multiple tables at one call for Update() method but it did not work. Then i made a simple application to Update data of one table. Still i am getting same problem. ( No row is being Updated/Deleted/Inserted ). Here is the code. public void DoUpdate () { DataSet ds; SqlDataAdapter da; this .da = new SqlDataAdapter ( "Select companyName, address from companies; Select sms from Inventories" , @"MyConnectionString" ); this . da . UpdateCommand = new SqlCommand ( "Update Companies set companyName='New Compnay'; Update Inventories set SMS='New ...Show All
msedi Use of Transactions for long slow process and blocking
Hello, I have a question about the appropriate use of transactions when performing a long task. I have a C# application which runs on a semi-frequent basis. The application downloads data from a number of different data sources, post-processes the data on the fly, then progressively writes the post-processed data out to a local SQL Server (2000) database. The download of data takes about 3 hours, and quite commonly dies part way through (due to unreliable data sources). It seems like a good idea that I wrap the whole download process in a single transaction (using the SqlTransaction object), so that I can roll back if something goes wrong part way through. What I hadn't anticipated, however, is that by wrapping the process in a ...Show All
explode MySql- Help me
I'm with a error in my mysql, I want to fill my database by a WinForms. An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in mysql.data.dll Additional information: #42000Voce tem um erro de sintaxe no seu SQL proximo a 'page) VALUES (''', '''', '''', '''', '''', '''', '''', '''', '''', '''', '''')' na linha 1 My code is here down. using System; using MySql.Data.MySqlClient; using System.Data; namespace Rodrigues__Projeto { /// <summary> /// Summary description for Acesso. /// </summary> class SQL_methods { public static MySqlConnection Conexao_mysql() { MySqlConnection conn = new MySqlConnection(); try { ...Show All
BobP - BIM Merging datasets causes an exception within .NET
We have an application that uses DataSets in conjunction with Windows Forms-based wizards. Each wizard has its own DataSet. When you finish one wizard it merges its data with that of the others, so at the end of the process, there is one DataSet with all the rows in it. The DataSets can contain any number of tables. The DataSet.Clone() method is used to make an empty DataSet, so each instance of DataSet has the same schema. However, from time to time as the application is being used, an exception occurs from deep within .NET at the point where the DataSets are merged. Below are the details of the exception that occurs (I have censored the company namespaces and types for privacy reasons): NullReferenceException - Object reference not ...Show All
Vladox Managed DirectX 64bit
We have a managed directX application that consistently runs out of memory on 32bit system because of large datasets. These are datasets that are bigger than 3Gb and fail without excessive fragmentation of the LOH. I've been investigating running under windows XP 64bit and Vista 64bit. The February 2007 DirectX SDK doesn't appear to have 64bit managed directx. What are my options (Rewriting our app native isn't one of them). Jamie Briant " "Jamie Briant"@discussions.microsoft.com " < "= UTF-8 B SmFtaWUgQnJpYW50 ="@discussions.microsoft.com > wrote in message news:9040eafa-23ac-4c52-9234-4074e6cc8f17@discussions.microsoft.com ... We have a managed directX appl ...Show All
CV. I can't access to ROW read with DATAADAPTER and DATASET~!!!
Good morning, friends. I have a hard problem at the same time, simple.. I'm using DataAdapter and DataSet for Read, insert or change one row of course than select string. I use similar code that I show to continue. da: DataAdapter, ds: DataSet, dr: DataRow 'Always I read one row of table with Select string. If read one, mody the items of this row, so I insert a new row. strSql = "SELECT * FROM namTable WHERE c1=" & C1 & " AND c2=" & ... & " AND c8=" & c8 da.SelectCommand = NEW SqlClientCommand(strSQL, conex) DIM cb AS NEW SqlCommandBuilder(da) da.UpdateCommand = cb.GetUpdateCommand da.InsertCommand = cb.GetInsertCommand da.MissingSchemaAction = MissingSchemaAction.AddWithK ...Show All
Sebi Tauciuc Web Service Snafu
I am trying to build a web service that supports a single signon transaction. This would be using vb.net / framework v1.1. The transaction is a SAML assertion request. I have all functionality coded, but I believe I need to use xml serialization to handle the request and deliver the required response (see request message below) Here is an example of the incoming message: < xml version='1.0' encoding='UTF-8' > <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body> <samlp:Request xmlns:samlp='urn:oasis:names:tc:SAML:1.0:protocol' ...Show All
tuhack Differences in Threading
hello there! im very confused in threading topics even if im looking and reading at MSDN libraries. the authors just give too much code on their samples. i just need straight-to-the-point explanations. so heres what im asking. hope somebody can answer this. Q: What are the differences of Monitor, Mutex, AutoResetEvent, Semaphores ok, this it. so hope somebody answer this question. thanks! ;-) Hi, JerberSoft I recommend you read the whitepaper that Albahari Joseph wrote on Thread Programming in C#. You will find a lot of information about the different lock mechanisms and more background information: http://www.albahari.com/threading/threading.pdf Thank you What more would you like to know Mark. Hi, ...Show All
