Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello there,

I have a sql string now, and I need to send it in, for every day between 2 dates. like, if the first date yould be, 01.01.0001 and the last date would be 03.01.0001 then, the string should be send 3 times in with every date (01. + 02. + 03.01.0001)

Any ideas for I can integrate that in my script when I already need to send the string in for every selected member ID?

That means, if I have 3 IDs, and 3 days, there would be 3 strings for every ID = 9 strings per total.

Please note, that the dates are dynamic as well as the amout of IDs.

What I have tried:

C#
foreach (DataRow row in m_dt.Rows) {
                foreach (var item in row.ItemArray) {
                    string sqlString = "INSERT INTO [table] ([id] ,[day] ,[month] ,[year]) VALUES('" + item + "', '" + reason + "', '10', '08', '2016', '1' )";
                    Sendin( sqlString );
                }
Posted
Updated 17-Nov-16 21:50pm
Comments
OriginalGriff 16-Nov-16 2:11am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
TheRealProgrammer 16-Nov-16 2:25am    
So what exactley you do not understand? I got a script that sends in a string for each item in my ID DataRow. I also want to send in the script for every date the user uses as input.
Sinisa Hajnal 16-Nov-16 3:07am    
And you also resolved it quite nice with double for loop. I personally would do inner loop in stored procedure with ID, start date and end date as parameters.
TheRealProgrammer 16-Nov-16 3:31am    
How should that look like? I have no idea.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900