|
Thanks for the advice, Mycroft Holmes!
I'll begin sketching an article and then submit it to codeproject.com.
All the very best,
Mihnea
modified 20-Aug-18 21:01pm.
|
|
|
|
|
IF you have any question regarding any topic then you should put here.
And Your application is not user friendly. and you should a lot of Update for your application.
OkIf you can think then I Can.
|
|
|
|
|
I wrote a custom pipeline component to validate csv data before inserting into Sql server DB.
my problem is I have to be able to read the following data and retreive each field data to check if required fields are empty or not and then let the orchestration process the data.
my Ibasemessage.bodypart looks like foll:
"<Sales xmlns=\"http://ADI.ADI_FlatFile\">
<SalesDetailInfo DealID=\""Deal #\" Logon_StoreID=\"Logon/Store#\" CustomerID=\"Customer #\" Customer_Name_Salutation=\"Customer Name Salutation\" Customer_First_Name=\"Customer First Name\" Customer_Middle_Name=\"Customer Middle Name\" Customer_Last_name=\"Customer Last Name\" Customer_Name_Suffix=\"Customer Name Suffix\" Customer_Employer_name=\"Customer Employer Name\" Customer_Job_Title=\"Customer Work Position/Job Title\" Customer_Birth_Date=\"Customer Birth Date\" Address=\"Address\" Address2=\"Address 2\" City=\"City\" State=\"State\" Zipcode=\"Zip\" HomePhone=\"Home Phone\" WorkPhone=\"Work Phone\" CellPhone=\"Cell Phone\" Email=\"EMail\" StockID=\"Stock #\" VIN=\"VIN\" Make=\"Make\" Odometer=\"Odometer\" Ext_Color=\"Exterior Color\" Int_Color=\"Interior Color\" Veh_Type_N_U_C=\"New/Used/Certified\" Agreed_Selling_Price=\"Agreed Selling Price\" MSRP=\"MSRP\" Trade1_StockID=\"Trade 1 Stock #\" Trade1_VIN=\"Trade 1 VIN\" Trade1_Payoff_Amount=\"Trade 1 Payoff Amount\" Trade1_ACV=\"Trade 1 ACV\" Trade2_StockID=\"Trade 2 Stock #\" Trade2_VIN=\"Trade 2 VIN\" Trade2_Payoff_Amount=\"Trade 2 Payoff Amount\" Trade2_ACV=\"Trade 2 ACV\" Salesman1_ID=\"Salesman 1 #\" Salesman1_FirstName=\"Salesman 1 First Name\" Salesman1_LastName=\"Salesman 1 Last Name\" Salesman1_Email=\"Salesman 1 Email\" Salesman2_ID=\"Salesman 2 #\" Salesman2_FirstName=\"Salesman 2 First Name\" Salesman2_LastName=\"Salesman 2 Last Name\" Salesman2_Email=\"Salesman 2 Email\" SalesManager_ID=\"Sales Manager #\" SalesManager_FirstName=\"Sales Manager First Name\" SalesManager_LastName=\"Sales Manager Last Name\" SalesManager_Email=\"Sales Manager Email\" F_I_managerID=\"F&I Manager #\" F_I_ManagerFirstName=\"F&I Manager First Name\" F_I_ManagerLastName=\"F&I Manager Last Name\" F_I_ManagerEmail=\"F&I Manager Email\" Deal_Sale_Type=\"Deal Sale Type\" Deal_Date=\"Deal Date\" Term=\"Term\" First_Payment_Date=\"First Payment Date\" Cash_Down=\"Cash Down\" Bank_Code=\"Bank Code\" Bank_Name=\"Bank Name\" Purchase_Monthly_Payment=\"Purchase Monthly Payment\" Amount_Financed=\"Amount Financed\" Deferred_Balloon_Payment=\"Deferred/Balloon Payment\" Base_Payment=\"Base Payment\" Lease_Monthly_payment=\"Lease Monthly Payment\" Net_Capitalized_Cost=\"Net Capitalized Cost\" Residual_Amount=\"Residual Amount\" Yearly_Miles=\"Yearly Miles\" Penalty_Rate=\"Penalty Rate\" Warranty_Company=\"Warranty Company\" Warranty_Miles=\"Warranty Miles\" Warranty_Term=\"Warranty Term\" Model_Number=\"Model Number"\" xmlns=\"\" />
<SalesDetailInfo DealID=\""311154\" CustomerID=\"50160\" Customer_Last_name=\"MERCEDES-BENZ OF HOUSTON NORTH\" Address=\"17510 NORTH FWY\" City=\"HOUSTON\" State=\"TX\" Zipcode=\"77090-4902\" HomePhone=\"2818856000\" StockID=\"2744\" VIN=\"WDDHF5GBXAA113364\" Make=\"MERCEDES-BENZ\" Odometer=\"12\" Ext_Color=\"WHITE\" Veh_Type_N_U_C=\"NEW\" Agreed_Selling_Price=\"52484.00\" MSRP=\"0\" Trade1_Payoff_Amount=\"0\" Trade1_ACV=\"0\" Trade2_Payoff_Amount=\"0\" Trade2_ACV=\"0\" Salesman1_ID=\"997\" Salesman1_FirstName=\"DEALER\" Salesman1_LastName=\"TRANSFER\" SalesManager_ID=\"351\" SalesManager_LastName=\"STERN\" F_I_managerID=\"2950\" F_I_ManagerLastName=\"VASQUEZ\" Deal_Sale_Type=\"P\" Deal_Date=\"01/08/2010\" Term=\"0\" First_Payment_Date=\"01/29/2010\" Cash_Down=\"0\" Bank_Code=\"CASH\" Bank_Name=\"CASH\" Purchase_Monthly_Payment=\"52484.00\" Amount_Financed=\"52484.00\" Deferred_Balloon_Payment=\"0\" Residual_Amount=\"0\" Yearly_Miles=\"0\" Penalty_Rate=\"0\" Warranty_Company=\"Vehicle Service Contr\" Warranty_Miles=\"100000\" Warranty_Term=\"60\" Model_Number=\""\" xmlns=\"\" />
</Sales>
I am unable to understand this format and how do I retreive my field names from this stream of data :
eg: I have to check if (Deal# = "" & VIN ="") then
"DO NOT PROCESS THE ROW"
"GO TO NEXT ROW "
"AND INSERT ONLY THOSE ROWS THAT HAVE rREQUIRED FIELDS"
"I HAVE 73 fields in each ROW.
"1st row is header row (I need to exclude that row too)
HOW DO I DO THIS , Please any support is gr8tly appreciated
|
|
|
|
|
This format is simply an XML file.
To manipulate the message body into a BizTalk pipeline, you have to change the BodyPart of your message object to another stream you populate with modified data.
Essentially, you must do the following in the component Execute method:
1. Save the original BodyPart value in a variable (e.g. origBody)
2. Assign a new instance of VirtualStream to the BodyPart property
3. Create an XmlReader from origBody
4. Create an XmlWriter to populate the new BodyPart stream
5. Loop through the nodes using the XmlReadr and write data to the XmlWriter according to your logic.
6. Return the modified message.
Still, if you only want to translate a message to a schema to another I strongly suggest you to create a Map and apply it to your receive port. You can implement your translation logic more easily by using the BizTalk map designer or a custom XSL transform.
|
|
|
|
|
|
My initial impressions:
See if GetItem() is returning the correct item.
See if Items.Remove() is actually reducing the size of the collection.
Post the Store.Save() method so we can see what's going on in there.
|
|
|
|
|
I am not very familiar with this control and would think its possible to do following easily - however I cannot find how.
I have a listview control with 3 levels. Level 1 (root parent) corresponds to a database name, level 2 table name and level 3 field name. The user can double click at any level to add or remove that level (and all below it) to a database query.
How do you check what level you are at? Also, how do I return all the parent and root parent of a node?
Example Tree:
Root Parent (lvl 1) Children (lvl 2) Grandchildren or field level(lvl 3)
Users Personal FirstName, LastName
Address Street, ZIP
Transactions ....etc
Lets say I want to add FirstName to my query, so I want a return of "Users.Personal.FirstName" as a string. How do I do this?
|
|
|
|
|
mbangh wrote: I have a listview control
You mean a TreeView control?
I keep seperate lists of nodes as well as the TreeView, I search the List instead of the TreeView.
|
|
|
|
|
I meant TreeView control.
Any other ideas?
|
|
|
|
|
use treeView1.SelectedNode.Level to get the level.
use the Parent to get the parent and Node to get the Child nodes.
But I would also recomend a separate list for the search.
|
|
|
|
|
Would a separate list just be quicker for searching, or is there another reason why you recommend it?
|
|
|
|
|
could be quicker but that's not why.
The main reason is that it would be simpler to search.
|
|
|
|
|
Hello every one,
I am trying to store some Unsigned long values in sqlite database using the sqlite.data.dll in c# windows application
i tried to take BigInt as datatype in database but it resulted overflow exception, the result was obvious unsigned long value was too big
So I switched the data type to Numeric in database ... now data is inserting properly
but when i try to retreive the value back using sqlitedatareader the value is truncated
I am totally lost which data type should i use to store ulong value in sqlite database
i dont want to take varchar datatype and if I use binary i'll not be able to query on table for
ulong values
Can any one please help me out what should i useabhinav
|
|
|
|
|
The problem is in SQLite sources:
SQLiteStatement.BindParameter:
case DbType.Int64:
case DbType.UInt64:
this._sql.Bind_Int64(this, index, Convert.ToInt64(obj2, CultureInfo.CurrentCulture));
return;
I dnt know any workaround but I'll try to find...
Here's also uint64-related link: http://sqlite.phxsoftware.com/forums/t/904.aspx[^]
=update=
By the way I've found a workaround:
INSERT query:
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "insert into tt (text, Value) values (@text, @tt)";
cmd.Parameters.AddWithValue("@text", value.ToString());
cmd.Parameters.AddWithValue("@tt", (long)value).DbType = DbType.UInt64;
cmd.ExecuteNonQuery();
}
SELECT query:
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "select Value from tt order by Value desc";
var reader = cmd.ExecuteReader();
while (reader.Read()) {
long l = (long) reader[0];
Console.WriteLine(*((ulong*)&l));
}
reader.Close();
cmd.ExecuteScalar();
}
SQLite query for table creation:
CREATE TABLE "tt" (
"ID" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"Text" TEXT NOT NULL,
"Value" UNSIGNED BIG INT NOT NULL
) Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
Hello Dmitry,
First of all thanks a lot for your quick reply
this work around works great and the value is storing and retreiving properly but now the problem is I cant query the the 'value' field of 'tt' table
select * from tt where value = 18446744073709551614
this does not work
can you please help me.
thanks a lot again for your helpabhinav
|
|
|
|
|
Yeah, you should always pass ulong value as parameter, not as a string inside a query:
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "select * from tt where value = @val";
cmd.Parameters.AddWithValue("@val", (long)18446744073709551614ul).DbType = DbType.UInt64;
var reader = cmd.ExecuteReader();
...
} Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
thanks Dmitry that did the trick abhinav
|
|
|
|
|
Good afternoon.
I currently write application to hook copy,cut,paste using ICopyHook whit visual studio 2008.
When I compile my application I have compil error CComModule can't not instantiate abstract class...
I try same code I found in codeproject compile whit vs 2005 and using vs 2008 I have same error.
Can you help me please thank you.
|
|
|
|
|
You need to post your code, in <pre> tags
aurelcly wrote: I have compil error CComModule can't not instantiate abstract class
This indicates that you are trying to create an instance of a class that is marked
abstract , which is impossible. Without the code it is we can't tell why this is happening.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Hi,
I have a question on windows application management. Lets take a look at my problem.
I am writing a windows application in C# 2005. I want that, at a time the application should run once. Unlike windows notepad or other programs the user can open as many windows he wants. But some trial software's don't allow opening more than one instance of same application.
Here, I also want the same facility(limitations) provided by trial software's. So that I can also run my application once at the same time.
|
|
|
|
|
|
Hi All,
In my application one thread waits for AutoResetEvents from various other threads.
I'm using WaitHandle.WaitAny(eventArray) to wait for any one of the events to become signalled then perform a switch on the returned index. My problem is that when 2 or more events are signalled at the same time I only get the array index for one event and the other signalled events are effectively lost. How can I ensure I respond to the other signalled events? It would have been better if subsequent calls to WaitHandle.WaitAny provided the index to these other signalled events on subsequent calls but it doesn't work like that.
Got any suggestions?
Thanks
Paulmodified on Thursday, February 18, 2010 3:55 AM
|
|
|
|
|
paul_b_baker wrote: It would have been better if subsequent calls to WaitHandle.WaitAny provided the index to these other signalled events on subsequent calls but it doesn't work like that.
Are you sure?
An AutoResetEvent remains signalled until it is used to satisfy a wait. WaitHandle.WaitAny is no different in that respect to WaitOne . So if two events are signalled at the same time, one will win the race to satisfy the wait and WaitAny will return it's index. The next WaitAny will succeed immediately and return the index of the other event.
Unless you mean that it is one event that is being signalled twice and one of the signals is being lost. This is a known problem with AutoResetEvent . If this is the case, you will have to use a different synchronization mechanism.
Nick----------------------------------
Be excellent to each other
|
|
|
|
|
Nick thanks but I'm quite sure I've got it right.
If two seperate events become signalled WaitHandle.WaitAny only returns the single lowest index and subsequent calls won't return the other signalled event indexes because, (I'm guessing here) AutoResetEvents are reset when the thread waiting on them runs. So my thread detects one event and runs but clears two or more events!?
Paul
|
|
|
|
|
Nick,
You're right.
In my code I added a check to see if a second event had been signalled when processing the first event. My check involved a call to WaitOne which reset the second event so (obvious after reading your post) I never saw it set in the main WaitAny loop!
I'm eating humble pie right now.
Thanks again.
Paul
|
|
|
|