Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 648823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:52:29+00:00 2026-05-13T21:52:29+00:00

Overflow :3 I’ve got a kind of hard-case question. So I’ll try clearly explain

  • 0

Overflow :3 I’ve got a kind of hard-case question.

So I’ll try clearly explain my idea
with my poor english :/ need
select to DataTable SOME values
from ???_GetDisplayData
procedure for each day of previos month (GROUP IT) where group rules for
different columns is different

I need to select some values in stored procedure from other stored procedure like this :

SELECT X FROM Y_Procedure(@ProcedureParameters)

Also I need to select from dynamic SQL Procedure like

Y_Procedure=@Y+'_Procedure'
SELECT X FROM Y_Procedure(@ProcedureParameters)

Also I need to load it to DataTable :-/

INSERT INTO @Report (CellHorizontal, CellVertical, CellValue) --to TABLE
SELECT Date,X2,X3 FROM Y_GetDisplayData(@Param)

    SET NOCOUNT OFF;

SELECT *
FROM @Report

GetDisplayData works as select with parameters and that doesn’t returns SQL DataTable
And there is no way to recode GetDisplayData’s procedures, it’s just constant procedures for me.

Finally I need to Group nodes from this table

    INSERT INTO @Report (CellHorizontal, CellVertical, CellValue) 
    SELECT T1.Date, 
IF ((Select grouptype...)=1) T1.X2 + T2.X2
    ELSE IF ((Select grouptype...)=2) AVG(T1.X2,T2.X2), 
IF ((Select grouptype...)=1) T1.X3 + T2.X3
    ELSE IF ((Select grouptype...)=2) AVG(T1.X3,T2.X3), 
    (SELECT T2.Date,X2,X3 FROM Y_GetDisplayData(@Param) T2
    WHERE T2.Date>T1.Date AND T2.Date>=T1.Date)
    FROM Y_GetDisplayData(@Param) T1
    GROUP BY EVERY DAY ???
    --and here is epic fail

I can make all stuff on asp server :

And C# allows me to use something like SelectCommand = IzmProc + "_GetDisplayData";

And then I will work (select special data) with DataTables on ASP.NET Server but it’s better to make all on SQL … But looking like it’s just unrealizable on SQL >_<

I gonna think about C# realization

but my code is very weird , got errors and doesn’t works >_<

    public static DataTable GetReport(string Param)
    {
        System.Configuration.ConnectionStringSettings connSetting = ConfigurationManager.ConnectionStrings["FlowServerConnectionString"];
        SqlConnection conn = new SqlConnection(connSetting.ConnectionString);
        SqlCommand cmd = new SqlCommand(Param + " _GetDisplayData 90,1,1,80,1,1,0");
        try
        {
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);

            //------------------------------------------------------------
            int dayOfWeekNumber = (int)DateTime.Today.DayOfWeek - (int)System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
            var previosWeekFirstDay = DateTime.Today.AddDays(-7 - dayOfWeekNumber);
            var yearsterday = DateTime.Today.AddDays(-1);
            var previosWeekLastDay = previosWeekFirstDay.AddDays(6);
            var previosMonthFirstDay = DateTime.Today.AddMonths(-1);
            previosMonthFirstDay = previosMonthFirstDay.AddDays(-previosMonthFirstDay.Day + 1);
            var previosMonthLastDay = previosMonthFirstDay.AddDays(DateTime.DaysInMonth(previosMonthFirstDay.Year, previosMonthFirstDay.Month) - 1);
            //-------------------------------------------------------------
            //Ok... now I need to group it on DT->everyday in month
            DataRow[] drx;
            DataTable newDT= new DataTable();
            foreach (DataRow row in dt.Rows)
            {
                string s = row["DailyRecTime"].ToString();
                drx = dt.Select("DailyRecTime= '" + s + "'");
                for (DateTime x = previosMonthFirstDay; x <= previosMonthLastDay; x.AddDays(1))
                {
                    foreach(DataRow drr in drx)
                    if (x.ToString() == drr[0].ToString())
                    {
                        drx = dt.Select("DailyRecTime= '" + s + "'");
                        DataRow newRow = new DataRow(); //ERROR HERE
                        double[] temp = new double[drx[0].Table.Columns.Count];
                        foreach (DataRow dr in drx)
                        {
                            for(int dc=1; dc<dr.Table.Columns.Count; dc++)
                            {
                                if (dr.Table.Columns[dc].Caption.ToString() == "C1_mol") //for example
                                    temp[dc] += double.Parse(dr[dc].ToString()); // nonsense
                            }
                        }
                        foreach (DataColumn dcl in drx[0].Table.Columns)
                        {
                            newRow.Table.Columns.Add(dcl);
                            newRow[dcl] = temp[dcl]; //error here :)
                        }
                        newDT.Rows.Add(newRow);
                    }
                }
            }

            return newDT;
        }
        catch (Exception)
        {
            return null;
        }

omg … :-/

and thank you for reading and trying to help me :3

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:52:30+00:00Added an answer on May 13, 2026 at 9:52 pm
     DataRow newRow = new DataRow(); //ERROR HERE 
    

    try

    DataRow newRow = dt.NewRow();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As in this Stack Overflow answer imagine that you need to select a particular
Similar Stack Overflow Question I want users to be able to search through my
Cannot dump Stack Overflow XML file into SQL Server 2008. Could you please explain
Stack Overflow offers related questions (on the right side of this question). I have
This question is overflow from the following question: How do I programmatically convert mp3
Posting a stack overflow question on stackoverflow.com, how amusing :-) I'm running some recursive
Good evening Stack Overflow, I've got a css issue tonight. I have a fixed-positioned
Dear Stack Overflow Community, I have a question regarding how to incorporate a WHERE
Hey Overflow. Long time listener, first time caller. So here's what I've got: I'm
I was reading Stack Overflow question How can I set Visual Studio to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.