Advertisement

04.30.2008 at 01:10PM PDT, ID: 23366716
[x]
Attachment Details

Updating a sql database from Visual Studio 2005

Asked by HawaiiDragon in SQLBase, Microsoft Visual C#.Net

Tags: SQL 2005, VS 2005, C#, ASP.Net

Hell programming Gods I have a new one for you guys that should be a cakewalk for you but I'm a noobie so its kicking my butt. I need to update a sql table cell with another field inside the sql table cell. I have made a schedugler, and once this goes off it needs to send an update to the sql data base. But before it can do that it has to update its self. Yea makes a lot of sience right okay here's what happens

Report #1 is scheduled to be ran every day at 2pm no big deal right. I have got one report running and once it runs once then I get stuck the SQL Database has a field in it called ReoccureInterval, In it I have the useres selecting from a drop down box hourly, daily, weekly, monthly, yearly, etc. Anyway I am trying to put this in the code behind of VS 2005 in C# language. I am running into problems though....  this is what I am doing and I am ohhhh soooo lost. Pleae help if you can.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
private void SetNextReport()
        {
            foreach (DataRow drow in ds1.Tables[0].Rows)
            {
                if ((string)drow["ReoccurInterval"] = "Monthly")
                {
                    drow["NextReport"] = (DateTime.Now.AddYears(1));            
                }
            }
          }
 
 
 
        //foreach (DataRow drow in ds1.Tables[0].Rows)
 
        //    //dt.rows[0]["check"] 
        //    if (DateTime.Now >= (DateTime)drow["NextReport"])
        //    {
 
 
 
        //if (DataColumn["ReoccurInterval"] = "Yearly")
        //{
        //  ds1 = DateTime.Now.AddYears(1);
        //}
 
        //        if (drow[0]["ReoccurInterval"] = "Yearly")
        //        {
        //            ds1 = DateTime.Now.AddYears(1);
 
        //        }
 
 
        //        else if ((string)drow["ReoccurInterval"] = "Monthly")
        //        {
        //            ds1 = DateTime.Now.AddMonths(1);
        //        }
 
        //        else if ((string)drow["ReoccurInterval"] = "Weekly")
        //        {
        //            ds1 = DateTime.Now.AddDays(7);
        //        }
 
 
        //        else if ((string)drow["ReoccurInterval"] = "Daily")
        //        {
        //            ds1 = DateTime.Now.AddDays(1);
        //        }
 
        //        else if ((string)drow["ReoccurInterval"] = "Hourly")
        //        {
        //            ds1 = DateTime.Now.AddHours(1);
        //        }
        //        //   }
        //    }
 
        //}
    }
 
Keywords: Updating a sql database from Visual St…
 
Loading Advertisement...
 
[+][-]05.02.2008 at 11:19PM PDT, ID: 21491483

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQLBase, Microsoft Visual C#.Net
Tags: SQL 2005, VS 2005, C#, ASP.Net
Sign Up Now!
Solution Provided By: Rrooter
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628