Click here to Skip to main content
15,909,747 members
Home / Discussions / C#
   

C#

 
GeneralRe: multiple regression for crime forecasting Pin
Alan Balkany13-Mar-08 10:56
Alan Balkany13-Mar-08 10:56 
QuestionConverting Ole Object(jpeg) into System.Drawing.Bitmap Problem [modified] Pin
cyberE-gor13-Mar-08 9:46
cyberE-gor13-Mar-08 9:46 
GeneralRe: Converting Ole Object(jpeg) into System.Drawing.Bitmap Problem Pin
Christian Graus13-Mar-08 9:53
protectorChristian Graus13-Mar-08 9:53 
GeneralRe: Converting Ole Object(jpeg) into System.Drawing.Bitmap Problem Pin
KaptinKrunch13-Mar-08 12:37
KaptinKrunch13-Mar-08 12:37 
GeneralRe: Converting Ole Object(jpeg) into System.Drawing.Bitmap Problem Pin
cyberE-gor13-Mar-08 13:01
cyberE-gor13-Mar-08 13:01 
GeneralRe: Converting Ole Object(jpeg) into System.Drawing.Bitmap Problem Pin
KaptinKrunch13-Mar-08 17:03
KaptinKrunch13-Mar-08 17:03 
GeneralRe: Converting Ole Object(jpeg) into System.Drawing.Bitmap Problem Pin
cyberE-gor14-Mar-08 5:40
cyberE-gor14-Mar-08 5:40 
Generalnull reference exception not set to create an object instance Pin
joynee13-Mar-08 9:02
joynee13-Mar-08 9:02 
i have a number in my table that i need to inser in the database.the loop is returning a null value.how to convert object to string .here is my code.
can anyone help on this..

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;


/// <summary>
/// Summary description for TMPerminent
/// </summary>
public class TMPerminent
{


#region Variables

OracleConnection con;

#endregion

#region CONNECTION STRING

public string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString2"];

# endregion


public TMPerminent()
{
OracleConnection con = new OracleConnection(connectionString);
}


//public void AddNewRow(DataRow gvWeekDays,DataRow gvHrsNewRow, DataRow gvTaskNewRow, string strTWODID,string strEmpTSID)
public void AddNewRow(string dayid, string dayhrs, ref DataRow gvTaskNewRow, string strTWODID, string strEmpTSID)
{
//string strDay = null;
//string strHrs = null;

//Get the values stored in the text boxes
string txtDivision = gvTaskNewRow[0].ToString();
string txtSegment = gvTaskNewRow[1].ToString();
string txtDetail = "0";//gvTaskNewRow[2].ToString();
string txtFuntion = "0";//gvTaskNewRow[3].ToString();
string txtDescription = "0";//gvTaskNewRow[4].ToString();
string txtTask = "0";//gvTaskNewRow[5].ToString();
string txtCounty = "0";//gvTaskNewRow[6].ToString();
string txtHighway = "0";//gvTaskNewRow[7].ToString();

//Get the values stored in the text boxes
txtDivision = gvTaskNewRow[0].ToString();
txtSegment = gvTaskNewRow[1].ToString();
txtDetail = gvTaskNewRow[2].ToString();
txtFuntion = gvTaskNewRow[3].ToString();
txtDescription = gvTaskNewRow[4].ToString();
txtTask = gvTaskNewRow[5].ToString();
txtCounty = gvTaskNewRow[6].ToString();
txtHighway = gvTaskNewRow[7].ToString();

//Prepare the insert Command of the DataSource control (inserting new record into the TASK TABLE)
string strInsertTask = "";
strInsertTask = "insert into TASK_WRK_ORDR_DTL (TXDOT_DIST_NBR,SGMNT_ID,DTL_CD,FUNC_CD,TASK_WRK_ORDR_CD,TXDOT_CNTY_NBR,HWY_CD,MISC_DSCR_TXT) values (" +
txtDivision + "," + txtSegment + "," + txtDetail + "," + txtFuntion + "," + txtTask + "," + txtCounty +
"," + txtHighway + "," + txtDescription + ")";

////Select the hrs data in the row
//for(int i=0 ; i < 7 ; i++ )
//{
// if (gvHrsNewRow[i].ToString() != string.Empty)
// {
// strHrs = gvHrsNewRow[i].ToString();
// strDay = gvWeekDays[i].ToString();
// break;
// }
//}

//prepare the insert command for the HRS table
string strInsertHrs = "";
//dayhrs = "123";
//dayid = "12";
strInsertHrs = "insert into TS_DAILY_ACTV (DAY_ID,TWOD_ID,EMP_TMSHT_ID,WRK_HRS_QTY) values (" + dayid + "," + strTWODID + "," + strEmpTSID + "," + dayhrs + ")";
//OracleConnection con = new OracleConnection(connectionstring);
OracleCommand cmdInsertTask = new OracleCommand(strInsertTask,con);
OracleCommand cmdInsertHrs = new OracleCommand(strInsertHrs,con);

con.Open();

cmdInsertTask.ExecuteNonQuery();
cmdInsertHrs.ExecuteNonQuery();

con.Close();
GeneralRe: null reference exception not set to create an object instance Pin
led mike13-Mar-08 9:21
led mike13-Mar-08 9:21 
General[Message Deleted] Pin
joynee13-Mar-08 9:23
joynee13-Mar-08 9:23 
GeneralRe: null reference exception not set to create an object instance Pin
led mike13-Mar-08 9:37
led mike13-Mar-08 9:37 
GeneralRe: null reference exception not set to create an object instance Pin
Giorgi Dalakishvili13-Mar-08 9:58
mentorGiorgi Dalakishvili13-Mar-08 9:58 
GeneralRe: null reference exception not set to create an object instance Pin
Ravenet13-Mar-08 17:07
Ravenet13-Mar-08 17:07 
GeneralRe: null reference exception not set to create an object instance Pin
Justin Perez14-Mar-08 3:00
Justin Perez14-Mar-08 3:00 
Generalcrystal report issue (hiding objct at runtime) Pin
Harvey Saayman13-Mar-08 7:46
Harvey Saayman13-Mar-08 7:46 
QuestionPreventing moving a toolstrip from one toolstripcontainer to another Pin
RobMaddison13-Mar-08 7:32
RobMaddison13-Mar-08 7:32 
QuestionHow to save drawing from picture box drawn in GDI+ into bmp file type? Pin
yuenli13-Mar-08 5:54
yuenli13-Mar-08 5:54 
AnswerRe: How to save drawing from picture box drawn in GDI+ into bmp file type? Pin
led mike13-Mar-08 6:09
led mike13-Mar-08 6:09 
GeneralRe: How to save drawing from picture box drawn in GDI+ into bmp file type? Pin
leppie13-Mar-08 8:33
leppie13-Mar-08 8:33 
AnswerRe: How to save drawing from picture box drawn in GDI+ into bmp file type? Pin
Skippums13-Mar-08 6:55
Skippums13-Mar-08 6:55 
GeneralRe: How to save drawing from picture box drawn in GDI+ into bmp file type? Pin
yuenli13-Mar-08 13:43
yuenli13-Mar-08 13:43 
GeneralRe: How to save drawing from picture box drawn in GDI+ into bmp file type? Pin
KaptinKrunch13-Mar-08 17:11
KaptinKrunch13-Mar-08 17:11 
GeneralEditing ComboBox with DataSource Pin
polishprogrammer13-Mar-08 5:44
polishprogrammer13-Mar-08 5:44 
GeneralToolbox icon for user control Pin
hain13-Mar-08 5:25
hain13-Mar-08 5:25 
GeneralRe: Toolbox icon for user control Pin
led mike13-Mar-08 5:37
led mike13-Mar-08 5:37 

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.