Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Sir,

I have some Proble, below

C#
dtab = clsUtility.SqlDataAdapter("select jj.JudgmentID from R_judgmentjudge jj inner join M_Judgmentjudges j on jj.JudgeID=j.JudgeID  Where j.JudgeID=" + JID + " order by jj.JudgmentID Desc" );

       tbcHeadNote.TabPages[0].Text = "HeadNote(" + dtab.Rows.Count + ")";
       tbcHeadNote.TabPages[0].Select();
       tbcHeadNote.SelectedTab = this.tbcHeadNote.TabPages[0];
       DataTable  dta=new DataTable();
       for (int i = 0; i < dtab.Rows.Count; i++)
       {
           try
           {
               String SQL = "SELECT   distinct (M_Statute.StatuteID),Convert(nvarchar(max),R_JudgmentStatute.Subject,103) as Subject, R_JudgmentNew.Appellants, R_JudgmentNew.Respondents, R_JudgmentNew.PageNo,M_JudgmentType.Abbrebiation,Case R_JudgmentNew.PubID WHEN 1 THEN 'PLJR' ELSE 'JLJR' END as Pub , R_JudgmentNew.VolYear as VolYearID, R_JudgmentNew.Vol,M_Year_1.Years as StYears,M_Year.Years AS volYear, M_Statute.StatuteName,R_JudgmentNew.JudgmentID   FROM  M_Statute INNER JOIN R_JudgmentStatute ON M_Statute.StatuteID = R_JudgmentStatute.StatuteID INNER JOIN R_JudgmentNew ON R_JudgmentStatute.JudgmentID = R_JudgmentNew.JudgmentID INNER JOIN M_JudgmentType ON R_JudgmentNew.JudgmentType = M_JudgmentType.JudgmentTypeID INNER JOIN M_Year ON R_JudgmentNew.VolYear = M_Year.YearID left outer join M_Year as M_Year_1 ON M_Statute.YearID = M_Year_1.YearID "

               SQL += "Where R_JudgmentNew.JudgmentID=" + Convert.ToInt32(dtab.Rows[0][0].ToString()) + "";

               dta = clsUtility.SqlDataAdapter(SQL);

             dt1.Merge(dta);
           }
           catch(Exception ex)
           {
           }


 }


In the Above code

How to append data dt1? where is wrong?
Posted
Updated 1-Jun-11 23:36pm
v2

Are you getting an exception, or are you just not seeing the new data in dt1?

Using the debugger will help you determine what's happening. We really can't help because we don't know anything about your database schema.
 
Share this answer
 
"Appending" one database to another one is logically contradictory operation in principle. First, the databases should have matching schema. The term "append" in inapplicable in principle, because it assumes the ordering relationship. The data in a database has no certain order from the client's perspective.

You can talk about merging, which is not trivial. Data in the database obey certain constraints such as uniqueness. Valid in each database, it can violate on merge.

Do this: http://en.lmgtfy.com/?q=merge+database[^]

—SA
 
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