I work on a web service project. Now, it has a 3rd part service which I must ask for data regular time on my own. How can I make a regular request at my server which is running the web service? One way is I create a window service to ask the 3rd part datas at regular time, and if has datas then the window service send a request to the web service in order to transmit the receive datas to web service. I do not like this way, cuz it must create more service. How can web service send a request on it's own? === Interest is power! ===
Libra
Posts
-
How does make web service's pull? -
Wonder of DataGrid imort from Excel fileThx for you help. I try as your said but it's trashy.:sigh:Select of a part datas is base on the Select of whole sheet. I wonder if the OleDb Engineer adjust the type of each excel column when transfer, so when the column looks has more numerical value that it make the numerical type, when the column looks has more string value that it make the string type.:~ === Game is power! ===
-
Wonder of DataGrid imort from Excel fileHas a Excel file like that: Title Field1 Field2 Filed3 1 AA 1.1 2 3a CC 3.3 4 DD 4.4 I wrote a program in order to import the excel file datas to DataGrid:
OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Test.xls; Extended Properties=Excel 8.0"); connection.Open(); DataTable dt = new DataTable("Orders"); OleDbDataAdapter da = new OleDbDataAdapter(); da.SelectCommand = command; da.Fill(dt); this.dataGridTest.DataSource = dt;
Why in the DataGrid show as: F1 Title F2 ------> This is header (null) Field2 Filed3 1 AA 1.1 2 (null) (null) (null) CC 3.3 ------> Note this line column 1 is null! 4 DD 4.4 If the Excel file like this: Title Field1 Field2 Filed3 1 AA 1.1 2a 3a CC 3.3 4a DD 4.4 That the DataGrid turns to like this: F1 Title F2 ------> This is header Field1 Field2 Filed3 ------> Note the Field1 now is not null (null) AA 1.1 ------> Note this line column 1 is null! 2a (null) (null) 3a CC 3.3 4a DD -
How to make DataColumn.Expression work?Haha..., I got the answer myself. If you write the sentence
this.dataColumn.Expression="Col1 * Col2";
after((System.ComponentModel.ISupportInitialize)(this.dataTable)).EndInit();
then it will work right. But if the code generate by IDE wizzard, it gererate the dataColumn code at the front part, and the sentence '(...).EndInit()' is generate at //Formxx part which must be generated at the end of mothed InitializeComponent(), so, the 'Expression' can not work. As the said, if you want to use 'DataCloumn.Express' property, the good way is written the code yourself after InitializeComponent(). :cool: === Game is power! === -- modified at 1:37 Friday 30th September, 2005 -
Rethrowing exceptions:What's wrong with this code? It workes well. When the program call the MyFn(s) and execute the throw state then it throw out a exception, in the Main() which make the MyFn(s) call most nearly, the try block catch the exception and goes to deal the exception code 'Console.WriteLine(...)'. === Game is power! ===
-
How to make DataColumn.Expression work?Had anybody found that DataColumn.Expression sometime is valid and sometime is invalid? If the DataTable which have a column define DataColumn.Expression binding a DataGrid which has a GridTableStyle, when your edit the grid and change the cloumn value which relation with the column has set 'Expression', the relation column MUST NOT calculate and display a new value. If I use DataTable.New to create a new DataRow and set value to the columns(not needn't set value to the column has set 'Expression'), and then use DataTable.Row.Add to add a new row, it sometimes can calculate and display a new value. But if I change the column's name and accordingly modify Expression's value, sometimes you surprise to found that it can not work, why? :confused::confused::confused: === Game is power! === -- modified at 23:24 Thursday 29th September, 2005
-
Way to access class memberpublic can access by all class, internal can access by it's namespace, protected can access by it's inherit class. How to access a member only by special base class or a class which implement the special interface? :confused: === Game is power! ===
-
How to override the Text property of Control class?I have the same problem as you say. If you know how to solve, tell me please. :((:((:(( === Game is power! ===
-
A wonder of double convert to integerI see. So that's say I can not get a very exact float value. But the other question is why the procedure is same, only diffrent between the begining value and loop times, it will make this difrrent. As you said, every time Math.Ceiling(2.00) must equal 3, but why in FunA() it is equal 2. They all are called by Math.Ceiling(value) and the value=2.00, the very small gap can not explain this result. === Game is power! ===
-
A wonder of double convert to integerIt already is double! === Game is power! ===
-
A wonder of double convert to integerSee the FunA() and FunB() result, why any diffent?
private void FunA() { double value; System.Text.StringBuilder sb = new System.Text.StringBuilder(); for( **value = 2.1;** value >= -1.1; value -= 0.1 ) sb.AppendFormat("Ceiling({0:f})={1} Floor({0:f})={2} Round({0:f})={3} (int)({0:f}+0.5)={4} Truncate({0:f})={5}\n", value, Math.Ceiling(value), Math.Floor(value), Math.Round(value), (int)(value+0.5), Decimal.Truncate(Convert.ToDecimal(value))); return sb.ToString(); } private string FunB() { double value; System.Text.StringBuilder sb = new System.Text.StringBuilder(); for( **value = 5.1;** value >= -1.1; value -= 0.1 ) sb.AppendFormat("Ceiling({0:f})={1} Floor({0:f})={2} Round({0:f})={3} (int)({0:f}+0.5)={4} Truncate({0:f})={5}\n", value, Math.Ceiling(value), Math.Floor(value), Math.Round(value), (int)(value+0.5), Decimal.Truncate(Convert.ToDecimal(value))); return sb.ToString(); }
Reuslts is: FunA(): Ceiling(2.10)=3 Floor(2.10)=2 Round(2.10)=2 (int)(2.10+0.5)=2 Truncate(2.10)=2 Ceiling(2.00)=2 Floor(2.00)=2 Round(2.00)=2 (int)(2.00+0.5)=2 Truncate(2.00)=2 Ceiling(1.90)=2 Floor(1.90)=1 Round(1.90)=2 (int)(1.90+0.5)=2 Truncate(1.90)=1 Ceiling(1.80)=2 Floor(1.80)=1 Round(1.80)=2 (int)(1.80+0.5)=2 Truncate(1.80)=1 Ceiling(1.70)=2 Floor(1.70)=1 Round(1.70)=2 (int)(1.70+0.5)=2 Truncate(1.70)=1 Ceiling(1.60)=2 Floor(1.60)=1 Round(1.60)=2 (int)(1.60+0.5)=2 Truncate(1.60)=1 Ceiling(1.50)=2 Floor(1.50)=1 Round(1.50)=1 (int)(1.50+0.5)=1 Truncate(1.50)=1 Ceiling(1.40)=2 Floor(1.40)=1 Round(1.40)=1 (int)(1.40+0.5)=1 Truncate(1.40)=1 Ceiling(1.30)=2 Floor(1.30)=1 Round(1.30)=1 (int)(1.30+0.5)=1 Truncate(1.30)=1 Ceiling(1.20)=2 Floor(1.20)=1 Round(1.20)=1 (int)(1.20+0.5)=1 Truncate(1.20)=1 Ceiling(1.10)=2 Floor(1.10)=1 Round(1.10)=1 (int)(1.10+0.5)=1 Truncate(1.10)=1 Ceiling(1.00)=1 Floor(1.00)=0 Round(1.00)=1 (int)(1.00+0.5)=1 Truncate(1.00)=0 Ceiling(0.90)=1 Floor(0.90)=0 Round(0.90)=1 (int)(0.90+0.5)=1 Truncate(0.90)=0 Ceiling(0.80)=1 Floor(0.80)=0 Round(0.80)=1 (int)(0.80+0.5)=1 Truncate(0.80)=0 Ceiling(0.70)=1 Floor(0.70)=0 Round(0.70)=1 (int)(0.70+0.5)=1 Truncate(0.70)=0 Ceiling(0.60)=1 Floor(0.60)=0 Round(0.60)=1 (int)(0.60+0.5)=1 Truncate(0.60)=0 Ceiling(0.50)=1 Floor(0.50)=0 Round(0.50)=0 (int)(0.50+0.5)=0 Truncate(0.50)=0 Ceiling(0.40)=1 Floor(0.40)=0 Round(0.40)=0 (int)(0.40+0.5)=0 Truncate(0.40)=0 Ceiling(0.30)=1 Floor(0.3 -
How about DataCloumn.ExpressionHas a 'dataGrid1' and assign to 'dataTable1', 'dataTable1' have 3 columns: Col1,Col2,Col3, and then: Col1.ColumnName = "Col1"; Col2.ColumnName = "Col2"; Col3.ColumnName = "Col3"; Col1.DataType = System.Decimal; Col2.DataType = System.Int32; Col3.DataType = System.Decimal; Col3.Expression = "Col1 * Col2"; Col3.ReadOnly = true; // it's auto set Why at runtime, edit Col1, Col2 of the 'dataTable1' and then leave to other row, but Col3's value has not change yet, has not any be computed? Additional: I had try to new a 'dataRow1', and then give value to dataRow1[0], dataRow1[1], and at last 'Add()' this row in 'dataTable1'. At this time, run dataTable1.Refresh() and found that 'Col3' shown correct. Why at this time the Expression could be used. :confused::(( Why learn more, unaware more?
-
How can I add control's icon on VS IDE's toolboxHaha, I found it myself.;) Make this class attributes will be ok. [DesignTimeVisible(true)] [ToolboxItem(true), ToolboxBitmap(typeof(myDialog), "myDialog.bmp")] public class myDialog : System.Windows.Forms.Form :cool::cool::cool: === Game is power! ===
-
How can I add control's icon on VS IDE's toolboxAt first, thanks for you help.:rose: I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'. (But funny is it can be selected the component at the Property card :( ) === Game is power! ===
-
How can I add control's icon on VS IDE's toolboxI develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox. I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work. My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area. I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can? :confused: === Game is power! ===
-
Can not display toolbar icons, a framework bug?I create a MDI contain form, add a MainMenu, a ImageList, a ToolBar, and the ToolBar relate the ImageList. When I use the function Application.EnableVisualStyles() to enable xp style, the toolbar icons are disappeared. But when I use instead of a manifest file, the toolbar icons display correct. Is this a bug with .net framwork 1.1?:confused: (I used VS.net2003 simplified chinese version) === Game is power! ===
-
What's different between OnLoad and [FormName]_Load?When an load event occur, you can call the function [FormName]_Load(object sender, System.EventArgs e) to deal, also or call the function On_Load(System.EventArgs e). What's diffrent between them?:confused: === Game is power! ===
-
What's different between Component and ControlWhat's different between System.ComponentModel.Component and System.Windows.Forms.Control? When will me use the Component but not the Control in design? Thanks. Game is power!