Search results for query: *

  1. Socarsky

    Convert a List<object> to a string[,] 2D array

    There is something important in this case that whether int type or numeric type exist in class object that we want to convert to string multidimensional array. It necessary to use .ToString() to get successful result if numeric data type exist in class object. Otherwise compiler does not like us :)
  2. Socarsky

    Convert a List<object> to a string[,] 2D array

    So this is it, with my own. var std = new List<Students>(); std.Add(new Students() { ID = "10", Name = "Karna", Surname = "Basalan", PassMark = "A" }); std.Add(new Students() { ID = "20", Name = "Kendar", Surname = "Nurwidiyanti", PassMark = "A" }); string[,] array2 = new string[2, 4]; for...
  3. Socarsky

    Convert a List<object> to a string[,] 2D array

    You are definitely right about progress of mine but sometimes we all look for birds fly not into our mouth ready roasted. But I got a sense of doing this case on my own after i read your reply. Thanks for your reply
  4. Socarsky

    Convert a List<object> to a string[,] 2D array

    I am in a difficulty to convert a List that is class object which populated from database, so far so good to have that list of object but I need its string[,] (2D) array as converted to apply a method which helps to get an print output. private void dateTimePicker1_ValueChanged(object sender...
  5. Socarsky

    int method to return string?

    Your approach is totally wrong, the method's return type must be string as jimcilhinney emphasis, then you can get a string value.
  6. Socarsky

    How can I maked this approach's opposite

    How can I passing values from a Form to another one directly? A receiver Form will be showing itself on screen and listening passing values which come from a main form. I know a way to do with delegate and event but I need its opposite way. Here is what I can do these code lines. This able to...
  7. Socarsky

    I need to add an additional column after SQLDataAdapater filled it out.

    Thanks for pointing my wrong approach where was that. Now I've resolved my issue thanks to you. DataTable t = new DataTable(); a.Fill(t); DataColumn newCol = new DataColumn("NewColumn", typeof(string)); newCol.AllowDBNull = true...
  8. Socarsky

    I need to add an additional column after SQLDataAdapater filled it out.

    I want to do that without "Computed Column" in SQL, because it's a column, which contain image and text depends a condition whether true or false. I got below, I cannot achieve to add a column with the filled rows' starter or end of it.
  9. Socarsky

    Have a visualization issue with DataGrid selection

    My program Window's grid has a TabControl, and this TabControl has three DataGrid in each TabControl's Item and last thing there is a Label upper side of TabControl to show how many lines of data contain in my text database file. I use this line of code in Window_Loaded...
  10. Socarsky

    What caused my DGW's paint event as failure

    I just deactivated to call DGWSTOP_RowPostPaint event but it does not change the matter with a good result which I expected to get. The case stand still. The DGW does not show <No data to display> even its row count 0. I also removed SetupDGWStop method to run but the matter is still the same.
  11. Socarsky

    What caused my DGW's paint event as failure

    Below event works fine but another thing causes its task runs failure. Here is the DGW paint event. if things goes well then DGW must show a string in the center of its as <No data to display> private void DGWSTOP_Paint(object sender, PaintEventArgs e) { if (DGWSTOP.RowCount...
  12. Socarsky

    I need a suggestion about DataGridView and DataTable

    c# - How to fit multiple tables into one datagridview - Stack Overflow
  13. Socarsky

    I need a suggestion about DataGridView and DataTable

    Yes, I execute two separate queries. And keep their result set in two separated DataTables not only one, because there are two fields different than the other. But I just got an idea to get their result set like one single query, and that means one DataTable is enough. But let me think this idea...
  14. Socarsky

    I need a suggestion about DataGridView and DataTable

    I must use two query to retrieve result into DataTable, I must also add two columns to DGW they represent two different data as information from the other table.
  15. Socarsky

    I need a suggestion about DataGridView and DataTable

    I need a suggestion that will give a proper idea. I have two tables in MS SQL 2008 Express. When my project open a WinForm that retrieve the data from DB as binding that to a DGW. So far so good but after an exact choosing to make an action that might insert data one of tables and the other...
  16. Socarsky

    Specified cast is not valid

    might it be a misunderstanding that caused this confusing? I don't use GetInt16 because it caused problem when SQL makes SUM()'s return with Int32 even my field is int16(smallint). When I noticed that SQL uses Int32 with SUM() function then I changed my code with int16 getBalanceQty =...
  17. Socarsky

    There is a strange issue hat causes a thrown

    Actually there was no problem when I use an Insert method because nQty always contain a date which is in the limit of float which set up as Decimal. There problem was as jmcilhinney's saying side. Now I solved it by adding typecast method.
  18. Socarsky

    Specified cast is not valid

    Thanks jmcilhinney, I open my eyes :) I handled that below getBalanceQty = Convert.ToInt16(reader.GetInt32(reader.GetOrdinal("QTY"))); I do not need SUM's return with Int32 that's why I don't care it's return as Int32, and also data always be in the boundary of Int16.
  19. Socarsky

    Specified cast is not valid

    I face with a matter that says "Specified cast is not valid." and then started to dig it to figured out. So, I found the reason but one thing made me curious to learn why does MSSQL Sum(nQty) with int32 datatype by itself? is this normal? I fount the matter with this code! for (int i = 0; i <...
  20. Socarsky

    There is a strange issue hat causes a thrown

    Here is the screenshot that proves an issue: The thrown is mentioning this : "Specified cast is not valid." And here is my method's code: private Int32 MSSQLCheckQty() { Int32 getBalanceQty = 0; string strConn = "Data Source=19xxxxx;Initial...
Back
Top Bottom