Click here to Skip to main content
15,891,409 members
Home / Discussions / C#
   

C#

 
GeneralXML Serializing a Color Pin
Joel Holdsworth1-Jun-04 7:26
Joel Holdsworth1-Jun-04 7:26 
GeneralRe: XML Serializing a Color Pin
leppie1-Jun-04 8:32
leppie1-Jun-04 8:32 
GeneralRe: XML Serializing a Color Pin
Joel Holdsworth1-Jun-04 10:38
Joel Holdsworth1-Jun-04 10:38 
GeneralFloating Toolbar Pin
maxbale1-Jun-04 7:21
maxbale1-Jun-04 7:21 
Generalupgrading to 2003 - problems with reports Pin
econnor1-Jun-04 6:19
econnor1-Jun-04 6:19 
GeneralRe: upgrading to 2003 - problems with reports Pin
LongRange.Shooter1-Jun-04 6:39
LongRange.Shooter1-Jun-04 6:39 
GeneralRe: upgrading to 2003 - problems with reports Pin
econnor1-Jun-04 8:09
econnor1-Jun-04 8:09 
GeneralSetting Up Update Pin
MrJJKoolJ1-Jun-04 6:13
MrJJKoolJ1-Jun-04 6:13 
Hi,

I need to send changes to database in web service sitting on another machine with DB. I was thinking of using the following code in order to
do the update:

<br />
<br />
SqlConnection myCon = new SqlConnection(sCon1);<br />
SqlDataAdapter da = new SqlDataAdapter();<br />
<br />
da.SelectCommand = @"INSERT INTO MidnightReadings " +<br />
                   "(MR_Date, Coal_Feeder_Tot, Coal_Silo_Level_Prct, Coal_Barn_Inv_Prct, Limestone_Feed_Total, LS_Silo_Level_Prct, Ammonia_Totalizer, " +<br />
                      "Prop_to_Burn_Totalizer, TwentyFourHr_SO2_Reduct, Limestone_Received, Ammonia_Received, Prop_Received, Est_hours_Dry_Oper_Hours, " +<br />
                      "Est_hours_Dry_Oper_Mins, LAB_Sulfur_Content_Prct, LAB_High_Heat_Val, CEMS_SO2_Daily_Avg, SO2_Daily, Raw_Water_Pump_Meter, " +<br />
                      "Reservoir_Level, Comments, Date_Rec_Added) " +<br />
					  "VALUES(@MR_Date, @Coal_Feeder_Tot, @Coal_Silo_Level_Prct, @Coal_Barn_Inv_Prct, @Limestone_Feed_Total, @LS_Silo_Level_Prct, " +<br />
                      "@Ammonia_Totalizer, @Prop_to_Burn_Totalizer, @TwentyFourHr_SO2_Reduct, @Limestone_Received, @Ammonia_Received, @Prop_Received, " +<br />
                      "@Est_hours_Dry_Oper_Hours, @Est_hours_Dry_Oper_Mins, @LAB_Sulfur_Content_Prct, @LAB_High_Heat_Val, @CEMS_SO2_Daily_Avg, " +<br />
                      "@SO2_Daily, @Raw_Water_Pump_Meter, @Reservoir_Level, @Comments, @Date_Rec_Added); " +<br />
                      " SELECT MR_ID, MR_Date, Coal_Feeder_Tot, Coal_Silo_Level_Prct, Coal_Barn_Inv_Prct, Limestone_Feed_Total, LS_Silo_Level_Prct, " +<br />
                      " Ammonia_Totalizer, Prop_to_Burn_Totalizer, TwentyFourHr_SO2_Reduct, Limestone_Received, Ammonia_Received, Prop_Received, " +<br />
                      " Est_hours_Dry_Oper_Hours, Est_hours_Dry_Oper_Mins, LAB_Sulfur_Content_Prct, LAB_High_Heat_Val, CEMS_SO2_Daily_Avg, " +<br />
					" SO2_Daily, Raw_Water_Pump_Meter, Reservoir_Level, Comments, Date_Rec_Added FROM MidnightReadings WHERE (MR_ID = @@IDENTITY)";<br />
<br />
SqlCommandBuilder cb = new SqlCommandBuilder(da);<br />
				<br />
da.Update(dsDiff,"MidnightReadings");<br />
myCon.Close();<br />
<br />


Does the code look correct for building my update?

Heath had said this is the most efficient way in order to update db.
As you can see my insert statement is big. Is this common to have such a
big sql statement or is there a short version I should be using?

Thanks,
JJ
GeneralRe: Setting Up Update Pin
flow55551-Jun-04 6:24
flow55551-Jun-04 6:24 
GeneralRe: Setting Up Update Pin
MrJJKoolJ1-Jun-04 8:16
MrJJKoolJ1-Jun-04 8:16 
GeneralRe: Setting Up Update Pin
flow55551-Jun-04 11:22
flow55551-Jun-04 11:22 
QuestionHow to hide a form if the user close it? Pin
Ariadne1-Jun-04 6:07
Ariadne1-Jun-04 6:07 
AnswerRe: How to hide a form if the user close it? Pin
LongRange.Shooter1-Jun-04 6:37
LongRange.Shooter1-Jun-04 6:37 
AnswerRe: How to hide a form if the user close it? Pin
Heath Stewart1-Jun-04 6:45
protectorHeath Stewart1-Jun-04 6:45 
GeneralShorten the String Pin
Adam °Wimsatt1-Jun-04 5:22
Adam °Wimsatt1-Jun-04 5:22 
GeneralRe: Shorten the String Pin
LongRange.Shooter1-Jun-04 8:13
LongRange.Shooter1-Jun-04 8:13 
QuestionHow do compile a dll and load it to the assembly in runtime? Pin
Louis Riel1-Jun-04 5:12
Louis Riel1-Jun-04 5:12 
AnswerRe: How do compile a dll and load it to the assembly in runtime? Pin
Heath Stewart1-Jun-04 6:36
protectorHeath Stewart1-Jun-04 6:36 
GeneralRe: How do compile a dll and load it to the assembly in runtime? Pin
Louis Riel1-Jun-04 9:12
Louis Riel1-Jun-04 9:12 
GeneralRe: How do compile a dll and load it to the assembly in runtime? Pin
Heath Stewart1-Jun-04 9:18
protectorHeath Stewart1-Jun-04 9:18 
GeneralRe: How do compile a dll and load it to the assembly in runtime? Pin
Louis Riel1-Jun-04 9:49
Louis Riel1-Jun-04 9:49 
GeneralRe: The Error Pin
Peter Vertes1-Jun-04 4:15
Peter Vertes1-Jun-04 4:15 
QuestionHow do I get a full list of assemblies and their versions of the GAC?? Pin
IrishSonic1-Jun-04 3:16
IrishSonic1-Jun-04 3:16 
AnswerRe: How do I get a full list of assemblies and their versions of the GAC?? Pin
Dave Kreskowiak1-Jun-04 4:42
mveDave Kreskowiak1-Jun-04 4:42 
Generaltooltip problem Pin
gulucay1-Jun-04 3:13
gulucay1-Jun-04 3:13 

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.