Click here to Skip to main content
15,908,264 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: add dataset to sql database Pin
Ramasubramaniam25-Aug-06 7:50
Ramasubramaniam25-Aug-06 7:50 
GeneralRe: add dataset to sql database Pin
Not Active25-Aug-06 8:50
mentorNot Active25-Aug-06 8:50 
AnswerRe: add dataset to sql database Pin
Not Active25-Aug-06 8:47
mentorNot Active25-Aug-06 8:47 
QuestionOne-to-many data insertion in SQL Server Pin
theblacklotus25-Aug-06 6:22
theblacklotus25-Aug-06 6:22 
AnswerRe: One-to-many data insertion in SQL Server Pin
theblacklotus25-Aug-06 7:40
theblacklotus25-Aug-06 7:40 
GeneralRe: One-to-many data insertion in SQL Server Pin
eggsovereasy25-Aug-06 8:42
eggsovereasy25-Aug-06 8:42 
GeneralRe: One-to-many data insertion in SQL Server Pin
theblacklotus25-Aug-06 10:50
theblacklotus25-Aug-06 10:50 
AnswerRe: One-to-many data insertion in SQL Server Pin
ToddHileHoffer25-Aug-06 8:13
ToddHileHoffer25-Aug-06 8:13 
I usually create a structure of the details item.
Here is an example of code that I use create a header record and then detail items.

<br />
<br />
<br />
<br />
 public void UpdateMonoLinePropMaxLimits(int RateGroupCode, DateTime EffectiveDate, MonoLineMaxLimit[] LimitsRows)<br />
    {<br />
        SqlConnection conn = UAIG.SQL.ConnectionManager.GetConnection();<br />
        SqlCommand cmd1 = new SqlCommand();<br />
        cmd1.CommandText = "dbo.uspUpdatePropMaxLimit";<br />
        cmd1.Connection = conn;<br />
        cmd1.CommandType = CommandType.StoredProcedure;<br />
        cmd1.Parameters.Add(new SqlParameter("@RateGroupCode", RateGroupCode));<br />
        cmd1.Parameters.Add(new SqlParameter("@EffectiveDate", EffectiveDate));<br />
        cmd1.Parameters.Add(new SqlParameter("@NetID", UAIG.Settings.ApplicationSettings.GetUser()));<br />
        //The return value comes from scope_identity() on the header table<br />
        SqlParameter prmReturnValue = new SqlParameter("@ReturnValue", SqlDbType.Int);<br />
        prmReturnValue.Direction = ParameterDirection.ReturnValue;<br />
        cmd1.Parameters.Add(prmReturnValue);<br />
        conn.Open();<br />
        SqlTransaction trans = conn.BeginTransaction();<br />
        cmd1.Transaction = trans;<br />
        cmd1.ExecuteNonQuery();<br />
<br />
<br />
        int MaxLimitGroup = int.Parse(prmReturnValue.Value.ToString());<br />
        SqlCommand cmd2 = new SqlCommand();<br />
        cmd2.CommandType = CommandType.StoredProcedure;<br />
        cmd2.Connection = conn;<br />
        cmd2.CommandText = "dbo.uspInsertMaxLimit";<br />
        cmd2.Parameters.Add(new SqlParameter("@MaxLimitGroup", MaxLimitGroup));<br />
        SqlParameter prmConstructionTypeCode = new SqlParameter("@ConstructionTypeCode", SqlDbType.Int);<br />
        cmd2.Parameters.Add(prmConstructionTypeCode);<br />
        SqlParameter prmSprinklered1_6 = new SqlParameter("@Sprinklered1_6", SqlDbType.Money);<br />
        cmd2.Parameters.Add(prmSprinklered1_6);<br />
        SqlParameter prmSprinklered7_8 = new SqlParameter("@Sprinklered7_8", SqlDbType.Money);<br />
        cmd2.Parameters.Add(prmSprinklered7_8);<br />
        SqlParameter prmNonSprinklered1_6 = new SqlParameter("@NonSprinklered1_6", SqlDbType.Money);<br />
        cmd2.Parameters.Add(prmNonSprinklered1_6);<br />
        SqlParameter prmNonSprinklered7_8 = new SqlParameter("@NonSprinklered7_8", SqlDbType.Money);<br />
        cmd2.Parameters.Add(prmNonSprinklered7_8);<br />
<br />
        foreach (MonoLineMaxLimit item in LimitsRows)<br />
        {<br />
            prmConstructionTypeCode.Value = item.ConstructionTypeCode;<br />
            prmSprinklered1_6.Value = item.Sprinklered1_6;<br />
            prmSprinklered7_8.Value = item.Sprinklered7_8;<br />
            prmNonSprinklered1_6.Value = item.NonSprinklered1_6;<br />
            prmNonSprinklered7_8.Value = item.NonSprinklered7_8;<br />
<br />
            cmd2.Transaction = trans;<br />
            cmd2.ExecuteNonQuery();<br />
<br />
        }<br />
<br />
        trans.Commit();<br />
        conn.Dispose();<br />
    }<br />
<br />
    public struct MonoLineMaxLimit<br />
    {<br />
        public int ConstructionTypeCode;<br />
        public decimal Sprinklered1_6;<br />
        public decimal Sprinklered7_8;<br />
        public decimal NonSprinklered1_6;<br />
        public decimal NonSprinklered7_8;<br />
    }<br />






how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06

GeneralRe: One-to-many data insertion in SQL Server Pin
theblacklotus25-Aug-06 8:44
theblacklotus25-Aug-06 8:44 
Questionhow to add new webpartzone and webparts at runtime Pin
ketan.raval25-Aug-06 5:17
ketan.raval25-Aug-06 5:17 
QuestionMultiView vs panels Pin
Drathmar25-Aug-06 4:58
Drathmar25-Aug-06 4:58 
AnswerRe: MultiView vs panels Pin
minhpc_bk25-Aug-06 13:45
minhpc_bk25-Aug-06 13:45 
QuestionBest Way to Serve Documents Pin
Jonathan Wood25-Aug-06 4:30
Jonathan Wood25-Aug-06 4:30 
QuestionSession Timeout - ASP.NET 2.0 Pin
seee sharp25-Aug-06 3:54
seee sharp25-Aug-06 3:54 
AnswerRe: Session Timeout - ASP.NET 2.0 Pin
minhpc_bk25-Aug-06 13:36
minhpc_bk25-Aug-06 13:36 
Questiondropdown binding Pin
bmadhura25-Aug-06 3:48
bmadhura25-Aug-06 3:48 
AnswerRe: dropdown binding Pin
Not Active25-Aug-06 4:17
mentorNot Active25-Aug-06 4:17 
AnswerRe: dropdown binding Pin
Coding C#25-Aug-06 4:44
Coding C#25-Aug-06 4:44 
QuestionProblem creating Repeater Template dynamically asp.net 2.0 [modified] Pin
Jay_se25-Aug-06 3:16
Jay_se25-Aug-06 3:16 
AnswerRe: Problem creating Repeater Template dynamically asp.net 2.0 Pin
playout25-Aug-06 10:30
playout25-Aug-06 10:30 
QuestionRe: Problem creating Repeater Template dynamically asp.net 2.0 Pin
Jay_se25-Aug-06 19:53
Jay_se25-Aug-06 19:53 
Questionpassing com parameters Pin
V.25-Aug-06 2:14
professionalV.25-Aug-06 2:14 
AnswerRe: passing com parameters Pin
minhpc_bk25-Aug-06 13:33
minhpc_bk25-Aug-06 13:33 
GeneralRe: passing com parameters Pin
V.28-Aug-06 20:28
professionalV.28-Aug-06 20:28 
Questionwebmethod call with parameter xml Pin
A M SOMAN25-Aug-06 1:29
A M SOMAN25-Aug-06 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.