Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

Bedevian

@Bedevian
About
Posts
20
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Violation of PRIMARY KEY constraint 'PK_Customers'.
    B Bedevian

    i am trying to update my customers table in the northwind database from XML file. Getting an Wrror Violation of PRIMARY KEY constraint 'PK_Customers'. Cannot insert duplicate key in object 'dbo.customers'. i used SqlCommandBuilder to build insert,update and delecte commands. DataSet DSRead = new DataSet(); DSRead.ReadXml("output.xml"); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand (queryString, connection); SqlCommandBuilder builder = new SqlCommandBuilder(adapter); connection.Open(); DataSet dataSet = new DataSet(); adapter.Fill(dataSet, tableName); dataSet = DSRead; //code to modify data in DataSet here builder.GetUpdateCommand(); //Without the SqlCommandBuilder this line would fail adapter.Update(dataSet, tableName); how can i write CommandBuilder to update, insert and delete. Thx

    C# database xml question announcement

  • Pocket PC Dataset.ReadXml OutOfMemoryException
    B Bedevian

    the xml file is 10 MB that's why i was getting an Error OutOfMemoryException, i used Emulator Properties Dialog Box, to increase memeory size from 128 to 256. the original xml file is around 27 MB, i can't copy it to the emulator, how can i increase the space in the emulator, i add Flash Memory File in the Emulator Properties Dialog Box. but i still can't copy it. i guess it's read only ?

    Mobile xml help

  • Pocket PC Dataset.ReadXml OutOfMemoryException
    B Bedevian

    i am trying to load a dataset from XML file, but i am getting an Error. "OutOfMemoryException" here is the code DataSet DSRead = new DataSet(); DSRead.ReadXml("\\Program Files\\Smartdeviceproject1\\output.xml"); i used the same code on windows application and its working fine.

    Mobile xml help

  • ERROR_HANDLER
    B Bedevian

    i am trying to write this code in C#.i have a problem with Err.Number how can i get error number in C#. Error number is always Zero but in VB it's show the correct Error Number !! VB.net On Error GoTo ERROR_HANDLER Dim TermID As Int32 = Convert.ToInt32(txtTermId.Text) Dim EmpNum As Int32 = Convert.ToInt32(EmployeeList.SelectedItem) objFuncs.LogIn(TermID, EmpNum, "", "") StatusBar1.Text = "You successfully logged in with Employee " & EmpNum ERROR_HANDLER: MessageBox.Show(Err.Number.ToString()) Select Case Err.Number And &HFFF Case ErrCOM_InvalidEmpPassword : MsgBox("Invalid password") Case ErrCOM_CouldNotFindEmployeeFromId : MsgBox("Could not find employee from ID") Case Else : MsgBox(Err.Description) End Select C# try { int TermID = Convert.ToInt32(txtTermId.Text); int EmpNum = Convert.ToInt32(EmployeeID.Text); objFuncs.LogIn(TermID, EmpNum, "", ""); richTextmsg.Text += "You successfully logged in with Employee " + EmpNum; } catch { MessageBox.Show(Information.Err().Number.ToString()); switch(Information.Err().Number & 4098) { case ErrCOM_EmpLoggedOnOtherTerm: MessageBox.Show("The employee is logged on to another terminal", 0, null); break; case ErrCOM_SomeoneAlreadyLoggedIn: MessageBox.Show("Someone else is already logged on to this terminal", 0, null); break; }

    C# csharp help question

  • Copy DBF file to MDB
    B Bedevian

    with this code i copy from one DBF to Another DBF. but how can i Copy DBF file to MDB this exapple is working fine string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + APP_PATH + "\\TMP ;Extended Properties=dBase IV"; OleDbConnection DBConnection = new OleDbConnection(ConnectionString ); InsertQuery = "INSERT into "+APP_PATH+"\\TMP\\"+DBFfile.ToString()+" Select * from "+APP_PATH+"\\"+DBFfile.ToString(); OleDbCommand InsertCommand = new OleDbCommand(InsertQuery,DBConnection); DBConnection.Open(); InsertCommand .ExecuteReader(); DBConnection.Close(); this one i need help, do i have to make a connection to DBF file ? string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+"\\MainDB.mdb"; OleDbConnection DBConnection = new OleDbConnection(ConnectionString); string InsertQuery = "INSERT into GNDSALE Select * from D:\\GNDSALE.DBF "; OleDbCommand InsertCommand = new OleDbCommand(InsertQuery,DBConnection); DBConnection.Open(); InsertCommand.ExecuteReader(); DBConnection.Close(); -- modified at 14:18 Wednesday 3rd May, 2006

    C# question help

  • Crystal Viewer 9 RDC
    B Bedevian

    here is my code CRAXDRT.Application crxApp = new CRAXDRT.Application(); CRAXDRT.Report crxRpt = new CRAXDRT.Report(); crxRpt = crxApp.OpenReport(@Application.StartupPath+"\\Report_1.RPT",null); string myExportFile = Application.StartupPath+"\\Report.txt"; crxRpt.ExportOptions.DiskFileName = myExportFile; crxRpt.ExportOptions.FormatType = CRAXDRT.CRExportFormatType.crEFTText; crxRpt.ExportOptions.DestinationType = CRAXDRT.CRExportDestinationType.crEDTDiskFile; crxRpt.ExportOptions.RTFExportAllPages = true; crxRpt.Export(false); after i export, i want to close the crxRPT and crxApp object. because i want to copy the latest database from the server to the my PC but i can't because these object are still connected to the database i try this but didn't work. crxRpt = null; crxApp = null;

    C# database sysadmin

  • Crystal Report ParameterFields
    B Bedevian

    i wrote a sales report, which works fine with my application if i include start date and end date in the database, {gndsale.dob} in {date.startdate} to {date.enddate}. but if i change the report to pass Parameter Fields, {gndsale.dob} in {?Start Date} to {?End Date} when i load the report first time it's okay i can see the correct parameters on the Page header and in Details, but if i load report 2nd time with different parameters , the page header is updated but the details not, some how i need to refresh crystalReportViewer1 after i pass parameters. ??? check this code ReportDocument1.Load(RptPath.ToString()); crystalReportViewer1.RefreshReport(); crystalReportViewer1.ReportSource = reportDocument1; paramFields = new ParameterFields (); ParameterField crParamFld = new ParameterField(); ParameterDiscreteValue CrparamValue = new ParameterDiscreteValue(); paramFields = crystalReportViewer1.ParameterFieldInfo; crParamFld = paramFields[0]; CrparamValue.Value = PassDT_Start; crParamFld.CurrentValues.Add(CrparamValue); ParameterField crParamFld_2 = new ParameterField(); ParameterDiscreteValue CrparamValue_2 = new ParameterDiscreteValue(); crParamFld_2 = paramFields[1]; CrparamValue_2.Value = PassDT_End; crParamFld_2.CurrentValues.Add(CrparamValue_2); crystalReportViewer1.ParameterFieldInfo = paramFields; crystalReportViewer1.ReportSource = reportDocument1; Or this code reportDocument1.SetParameterValue("Start Date",PassDT_Start ); reportDocument1.SetParameterValue("End Date",PassDT_End ); crystalReportViewer1.RefreshReport(); crystalReportViewer1.ReportSource = reportDocument1;

    C# database sales question

  • CrystalReportViewer PageDown
    B Bedevian

    i load a report in CrystalReportViewer. i want to scroll down by pressing page down, but this event it's not handle by crystalReportViewer. i used before Crystl32.OCX or Crystal control 9 , with these two control i could scroll down by pressing page down. Need help ASAP thx

    C# help

  • Export Crystal Report to txt file
    B Bedevian

    Hi In VB 6 I used to export crystal report to almost any type This sample “export report to txt file” Dim myExportFile As String myExportFile = App.Path + "\temp.xls" Report.ExportOptions.DiskFileName = myExportFile Report.ExportOptions.FormatType = crEFTText Report.ExportOptions.DestinationType = crEDTDiskFile Report.ExportOptions.RTFExportAllPages = True Report.Export (False) But in Visual Studio 2003 I can't Export to plain txt file Check out this code, // Set the Export type, this can be: // PDF, Excel, Word Doc, RTF Doc, // HTML 3.2, HTML 4.0 or CrystalReport no txt file // The path/location where the exported file will be saved string exportFilePath = MY_PATH+"\\RPTFOH\\Report1.DOC"; // Create an instance of the untyped report object ReportDocument oRpt = new ReportDocument(); // Load the report from disk oRpt.Load(@"C:\Test\RPTFOH\Report_1.rpt"); // Set the options for saving the exported file to disk DiskFileDestinationOptions oDest = new DiskFileDestinationOptions(); oDest.DiskFileName = exportFilePath; // Set the exporting information ExportOptions oExport = oRpt.ExportOptions; // Set the destination options oExport.DestinationOptions = oDest; // Set the location, this can be: // DiskFile, ExchangeFolder, MicrosoftMail or NoDestination oExport.ExportDestinationType = ExportDestinationType.DiskFile; // Set the Export type, this can be: // PDF, Excel, Word Doc, RTF Doc, // HTML 3.2, HTML 4.0 or CrystalReport oExport.ExportFormatType = ExportFormatType.WordForWindows; // Call the Export method to export the report oRpt.Export(); Please it's urgent, I need to export Report to txt file. Thanks in advance.

    C# csharp html visual-studio

  • Index DBF file
    B Bedevian

    I would like to know how to creat CDX index file for DBF Table. thx

    C# database tutorial

  • Export crystal report to TXT file
    B Bedevian

    i managed to export report pragmatically, by Setting the Export type to // PDF, Excel, Word Doc, RTF Doc, // HTML 3.2, HTML 4.0 or CrystalReport but i want to export report to txt file ! thx.

    C# html

  • join DBF files
    B Bedevian

    Yup i want to Create a Crystal Report, can i create a DBF file from my DATASET , if yes, then i can easily create a Crystal Report. i tried to create a blank report, then set Report data source to DATASET but it didn't work. thx Robert

    C# csharp tutorial

  • join DBF files
    B Bedevian

    thx man i used UNION ALL STATMENT a lot faster than reading DBF files one by one and adding Records. this code is with loop string ITMConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + ";Extended Properties=dBase IV"; OleDbConnection ITMConnection = new OleDbConnection(ITMConnString); string ITMSelectQuery = "Select * from "+ALOHA_PATH+"\\GNDITEM.DBF UNION ALL Select * from "+ALOHA_PATH+"\\"+datefolders.ToString()+"\\GNDITEM.DBF" ; MessageBox.Show(ITMSelectQuery); OleDbDataAdapter da= new OleDbDataAdapter(ITMSelectQuery ,ITMConnection); da.Fill (dsrefresh,"GNDITEM"); dv = new DataView(dsrefresh.Tables["GNDITEM"]); dataGrid1.DataSource = dv; ITMConnection.Close(); i have a small problem to generate a report out of dataset, before i was using the main DBF to Generate Report. how can i solve this problem.

    C# csharp tutorial

  • join DBF files
    B Bedevian

    i have a temporary folder which contains DBF files, it might be 1 dbf file up too 40 dbf files the structure of these DBF file are the same, i wrote a small app with C# to read these files one by one and add it to a main DBF file so i can run a report from one big DBF file. but this is a very slow solution. this is a small example just adding two fields TYPE,EMPLOYEE DirectoryInfo TMP_ReportDirectory = new DirectoryInfo(Application.StartupPath+"\\TMP"); FileInfo [] DbfFiles = TMP_ReportDirectory.GetFiles("*.dbf"); if (DbfFiles.Length != 0) { string ITMConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath+ "\\TMP;Extended Properties=dBase IV"; OleDbConnection ITMConnection = new OleDbConnection(ITMConnString); string ITMSelectQuery = "Select TYPE,EMPLOYEE from " + DbfFiles[iloop].ToString(); //MessageBox.Show(ITMSelectQuery); OleDbCommand ITMCommand = new OleDbCommand(ITMSelectQuery,ITMConnection); ITMConnection.Open(); OleDbDataReader ITMReader = ITMCommand.ExecuteReader(); string STOCKConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath+ ";Extended Properties=dBase IV"; OleDbConnection STOCKConnection = new OleDbConnection(STOCKConnString); while (ITMReader.Read()) { frmwait.statusBar1.Text = " Loading . . . . . . ."; string newID = ITMReader.GetValue(0).ToString(); string newLONGNAME = ITMReader.GetValue(1).ToString(); string STOCKInsertQuery = "INSERT INTO GNDITEM.DBF (TYPE, EMPLOYEE) VALUES (" + newID +",\"" + newLONGNAME + "\")"; //MessageBox.Show(STOCKInsertQuery); OleDbCommand STOCKInsertCommand = new OleDbCommand(STOCKInsertQuery,STOCKConnection); STOCKConnection.Open(); STOCKInsertCommand.ExecuteNonQuery(); STOCKConnection.Close(); } ITMConnection.Close(); ITMReader.Close(); STOCKConnection.Close(); }

    C# csharp tutorial

  • AutoComplete Combobox in datagrid
    B Bedevian

    hi can anyone help me to append this code, to have autocomplete combobox in datagrid ? using System; using System.Windows.Forms; using System.Drawing; using System.Data; using System.Diagnostics; namespace Stock { // Derive class from DataGridTextBoxColumn public class DataGridComboBoxColumnNAME : DataGridTextBoxColumn { // Hosted ComboBox control // private AutoCompleteComboBoxNAME comboBox; private ComboBox comboBox; private CurrencyManager cm; private int iCurrentRow; // Constructor - create combobox, register selection change event handler, // register lose focus event handler public DataGridComboBoxColumnNAME() { this.cm = null; // Create ComboBox and force DropDownList style this.comboBox = new ComboBox(); this.comboBox.DropDownStyle = ComboBoxStyle.DropDown; this.comboBox.Sorted = true; // Add event handler for notification of when ComboBox loses focus this.comboBox.Leave += new EventHandler(comboBox_Leave); } // Property to provide access to ComboBox public ComboBox ComboBox { get { return comboBox; } } // On edit, add scroll event handler, and display combo box protected override void Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible) { Debug.WriteLine(String.Format("Edit {0}", rowNum)); base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible); // if (!readOnly && cellIsVisible) { // Save current row in the datagrid and currency manager associated with // the data source for the datagrid this.iCurrentRow = rowNum; this.cm = source; // Add event handler for datagrid scroll notification this.DataGridTableStyle.DataGrid.Scroll += new EventHandler(DataGrid_Scroll); // Site the combo box control within the bounds of the current cell this.comboBox.Parent = this.TextBox.Parent; Rectangle rect = this.DataGridTableStyle.DataGrid.GetCurrentCellBounds(); this.comboBox.Location = rect.Location; this.comboBox.Size = new Size(this.TextBox.Size.Width, this.comboBox.Size.Height); // Set combo box selection to given text this.comboBox.SelectedIndex = this.comboBox.FindStringExact(this.TextBox.Text); // Make the ComboBox visible and place on top text box control this.comboBox.Show(); this.comboBox.BringToFr

    C# graphics debugging help question

  • Pocket PC disable toolbar Start
    B Bedevian

    i trying to write a code to disable toolbar start , run mstsc40.exe and to login Automatically "mstsc40.exe" using System.Diagnostics; i can't use Process object !!! thx

    Mobile

  • REGULAR_EXP
    B Bedevian

    this code let me write optional 4 digits and 3 decimal 1234.000 const string REGULAR_EXP = "(^-?\\d{1,4}\\.$)|(^-?\\d{1,4}$)|(^-?\\d{0,4}\\.\\d{1,3}$)"; i don't understand why if i type a number for ex. 12 and then add a minus (-) in front it works, but it doesn't if you type first minus (-) and then the number. i want REGULAR_EXP to add optional minus (-) before u type a number

    C# question

  • Datagrid, dataset, update, scroll
    B Bedevian

    i wrote this code to delete a record. string STOCKConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + ALOHA_PATH + "\\stockcontrol;Extended Properties=dBase IV"; OleDbConnection STOCKConnection = new OleDbConnection(STOCKConnString); string colID; colID= this.dataGrid1[index,0].ToString(); string STOCKUpQuery = "Delete * From STOCK.DBF Where ID=("+colID+")"; OleDbCommand STOCKUpCommand = new OleDbCommand(STOCKUpQuery,STOCKConnection); STOCKConnection.Open(); STOCKUpCommand.ExecuteNonQuery(); STOCKConnection.Close(); this record is deleted from stock.dbf, but i can still see this record in my datagrid1 i want to write a code to update my datagrid, dataset !!!! i wrote this code but it's not a good solution to refill datagrid1, coz datagtid1 is showing the records from the beginning , not from where i deleted the record but the scroll bar location is where i deleted the record !!!!!! string MyConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + ALOHA_PATH + "\\stockcontrol;Extended Properties=dBase IV"; OleDbConnection MyOleb = new OleDbConnection(MyConnection); OleDbDataAdapter da= new OleDbDataAdapter("Select * from STOCK.dbf",MyOleb); DataSet dsrefresh = new DataSet(); da.Fill (dsrefresh,"Stock"); dataGrid1.DataSource = dsrefresh.DefaultViewManager; dataGrid1.ReadOnly = true; MyOleb.Close(); Thx

    C# database announcement

  • Count Char in String
    B Bedevian

    i have a string "13255ad27d" this string it not fixed it might be "1212221121" but i know that the lenth is fixed = 10 wonna count how many 0,1,2.....9 and A,B,C...F if string is "1212221121" A=0 B=0 1=5 2=5 3=0 4=0 do this from 0-9 and A-f

    C#

  • [Message Deleted]
    B Bedevian

    [Message Deleted]

    C#
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups