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
K

Kranti1251984

@Kranti1251984
About
Posts
24
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to attach context menu to array of controls?
    K Kranti1251984

    Hi, I'm writing an application in c#.net, in which i've created array of control Button. I want to display a menu when user clicks any of the buttons in the array. I was able to create context menu for a single button, but not for the array, as coded below ... public class ButtonArray : System.Collections.CollectionBase { private readonly System.Windows.Forms.Form ContainerControl; public ButtonArray(System.Windows.Forms.Form Cont) { ContainerControl = Cont; } public void AddButton() { //code to create button btButton.MouseDown += new MouseEventHandler(btButton_MouseDown); } public void btButton_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { contextMenuStudInfo = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem menuItem1; menuItem1 = new System.Windows.Forms.MenuItem(); System.Windows.Forms.MenuItem menuItem2; menuItem2 = new System.Windows.Forms.MenuItem(); contextMenuStudInfo.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { menuItem1, menuItem2 }); menuItem1.Index = 0; menuItem1.Text = "Mark Present"; menuItem2.Index = 1; menuItem2.Text = "Mark Absent"; this.btButton.ContextMenu = contextMenuStudInfo; } } how to attach the context menu to each member of button control array? Thanks, Kranti -- modified at 5:31 Wednesday 3rd May, 2006

    C# csharp database data-structures tutorial question

  • How to retrieve attribute of type Time without time zone from postgreSQL?
    K Kranti1251984

    Hello, I am writing one simple C# .NET application in which I have to use some values retrieved from the database. But when I try to retrieve value of attribute of type Time without time zone it generates following exception {"Index was outside the bounds of the array."} System.Exception {System.IndexOutOfRangeException} This happens only when I try to retrive this type .. for other attribute types, it is working properly. My code is ... //-------------------------------------------------------------- String myQuery = "Select starttime from tblecture"; OdbcCommand myCommand = new System.Data.Odbc.OdbcCommand(myQuery, conn); OdbcDataReader dataReader = myCommand.ExecuteReader(); while(dataReader.Read())//Exception being generated on this line { //code to use database info } //-------------------------------------------------------------- Schema of tblecture table is: Table "public.tblecture" Column | Type | Modifiers -----------------+------------------------+---------------------------- lectureid | integer | not null starttime | time without time zone | Thanks, Regards, Kranti

    C# database csharp postgresql data-structures xml

  • Exception: Array index out of bounds
    K Kranti1251984

    the complete code is as follows ... //.................................. String connectionString = "Dsn=pgTEducation;database=teducation;server=192.168.0.135;port=5432;uid=divinet;readonly=0;protocol=6.4;fakeoidindex=0;showoidcolumn=0;rowversioning=0;showsystemtables=0;fetch=100;socket=4096;unknownsizes=0;maxvarcharsize=254;maxlongvarcharsize=8190;debug=0;commlog=0;optimizer=1;ksqo=1;usedeclarefetch=0;textaslongvarchar=1;unknownsaslongvarchar=0;boolsaschar=1;parse=0;cancelasfreestmt=0;extrasystableprefixes=dd_;lfconversion=1;updatablecursors=1;disallowpremature=0;trueisminus1=0;bi=0;byteaaslongvarbinary=0;useserversideprepare=0"; OdbcConnection conn = new System.Data.Odbc.OdbcConnection(connectionString); String classStartTime; conn.Open(); String myQuery = "Select starttime from tblecture"; OdbcCommand myCommand = new System.Data.Odbc.OdbcCommand(myQuery, conn); OdbcDataReader dataReader = myCommand.ExecuteReader(); try { while (dataReader.Read()) classStartTime = dataReader.GetTime(0).ToString(); } finally { dataReader.Close(); conn.Close(); } //.................................. thanks, Kranti

    C# csharp database data-structures question

  • Exception: Array index out of bounds
    K Kranti1251984

    the exception generated is "Array index out of bounds"

    C# csharp database data-structures question

  • Exception: Array index out of bounds
    K Kranti1251984

    even when i make it as ... //................................................... while (dataReader.Read()) //exception classStartTime = dataReader.GetTime(0).ToString(); //................................................... it generates the exception at the previous line i.e. the line containing "while", before going for this statement Thanks, Kranti

    C# csharp database data-structures question

  • Exception: Array index out of bounds
    K Kranti1251984

    Hi, I'm writing an application in c#.net and i'm completely new to it. Please refer to the following code in which i'm getting an exception... //..................................................................... String classStartTime; conn.Open(); String myQuery = "Select starttime from tblecture"; OdbcCommand myCommand = new System.Data.Odbc.OdbcCommand(myQuery, conn); OdbcDataReader dataReader = myCommand.ExecuteReader(); try { while (dataReader.Read()) //exception classStartTime = dataReader.GetTime(0).ToString(); } finally { dataReader.Close(); conn.Close(); } //..................................................................... I'm getting this exception for only column named "starttime"; for other fields this code works fine. Is there any other way to read a field of type time from database? Thanks, Kranti -- modified at 4:13 Wednesday 19th April, 2006

    C# csharp database data-structures question

  • 'System.NullReferenceException'
    K Kranti1251984

    hey, thanks a lot .. this type of initialization worked for me ... testlib::testlibControl *tmp1[] = __gc new testlib::testlibControl*[10]; tmp1[i] = new testlib::testlibControl; tmp1[i]->Location = System::Drawing::Point(x,y); tmp1[i]->Size = System::Drawing::Size(24, 29); Thanks, Kranti

    Managed C++/CLI question graphics data-structures

  • File transfer: Client-Server Communication
    K Kranti1251984

    Hi, I'm new to Visual C++.Net and I'm trying to write a client-server application in which I want to transfer an image file [JPEG/BMP/GIF] from server to client. Right now, I've written a code which just transfers "String" type of data from client to server and vice versa. How should I move ahead with images? Thanks, Kranti

    Managed C++/CLI c++ csharp sysadmin question

  • 'System.NullReferenceException'
    K Kranti1251984

    ok .. i've made required changes as follows but still i'm getting the same exception testlib::testlibControl *tmp1 __gc []; tmp1 = new testlib::testlibControl* __gc [10]; for(int i = 0; i < strength; i++) { tmp1[i]->Location = System::Drawing::Point(x,y); //exception .... ... } Thanks, Kranti

    Managed C++/CLI question graphics data-structures

  • 'System.NullReferenceException'
    K Kranti1251984

    i've created one DLL (testlib) and i want to use it in my application as an array of its instances ... i'm getting an exception as 'System.NullReferenceException' plz consider the following code .. //------------------------------------------------------------------------- testlib::testlibControl *tmp1 __gc[]; for(int i = 0; i < strength; i++) { tmp1[i] = new testlib::testlibControl; tmp1[i]->Location = System::Drawing::Point(x,y); //exception tmp1[i]->Size = System::Drawing::Size(24, 29); x += 30; this->Controls->Add(tmp1[i]); } //------------------------------------------------------------------------- Why does this code cause exception? Thanks, Kranti

    Managed C++/CLI question graphics data-structures

  • is there any function similar to sprintf in C++.Net?
    K Kranti1251984

    Hi, I've to write a query which requires a function similar to "sprintf" in C For e.g. String *query; // in c++.net sprintf(query, "Select * from table_name where number = %d", no); // in C How can this be done in this environment? Thanks, Kranti

    Managed C++/CLI csharp c++ database question workspace

  • problem with m_strCursor
    K Kranti1251984

    Hi, I've an application which creates HTML files. For that i'm using some database operations, which includes classes such as, CDatabase and CRecordSet etc. I'm getting an exception as "invalid cursor" since m_strCursor is getting set to some file name e.g. "test.html", which the application is creating. I'm not able to trace out, how the variable is getting set. Similarly, m_strFilter, m_strSort, m_strUpdateSQL, m_strRequeryFilter, m_strRequerySort are getting set to the same file name. Thanks, Kranti

    C / C++ / MFC html database debugging help

  • missing storage-class or type specifiers
    K Kranti1251984

    The same line with prototype of the function, is creating problems for the variable config of type CConfig. -- modified at 0:02 Tuesday 7th March, 2006

    C / C++ / MFC help question

  • missing storage-class or type specifiers
    K Kranti1251984

    I had tried this. But logically, it should not work and it doesn't work. But the problem i've mentioned is not the same one.

    C / C++ / MFC help question

  • missing storage-class or type specifiers
    K Kranti1251984

    No, that's the problem. Even though, correct header file is included, it works fine with CDlg but not with CDump. What should I do?

    C / C++ / MFC help question

  • missing storage-class or type specifiers
    K Kranti1251984

    I'm sorry, it is #include "Config.h"

    C / C++ / MFC help question

  • missing storage-class or type specifiers
    K Kranti1251984

    Hi, I'm getting following errors while creating 3 classes as mentioned below ... //--------------------------- class CConfig { //declarations }; //--------------------------- #include "Config.h" class CDlg { CConfig m_config; //no errors }; //--------------------------- #include "Config.h" class CDump { void MyFun(CConfig config); //errors }; //--------------------------- in class CDump i'm getting some errors as ... error C2146: syntax error : missing ';' before identifier 'config' error C2501: 'CConfig' : missing storage-class or type specifiers error C2501: 'config' : missing storage-class or type specifiers as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case? Thanks, Kranti -- modified at 23:59 Monday 6th March, 2006

    C / C++ / MFC help question

  • use of _ltoa
    K Kranti1251984

    hey, it worked! :) Thanks a lot! Kranti

    C / C++ / MFC data-structures help question

  • use of _ltoa
    K Kranti1251984

    when I check the values stored in both of the arrays, something like the following is observed ... binEffects[3] = '0' binEffects[2] = '0' binEffects[1] = '' binEffects[0] = '1' and the source array contains ... m_Effects[0] = '0' m_Effects[1] = '0' m_Effects[2] = '0' m_Effects[3] = '1' Even if i use memcmp(), it returns -1 if this example is concerned. Hence, i've a doubt regarding _ltoa function since it sets the values in binEffects. Kranti

    C / C++ / MFC data-structures help question

  • use of _ltoa
    K Kranti1251984

    Hi, I want to compare two character arrays containing binary values. For e.g. if m_Effects array contains 0001, string comparison does not return 0 even if binEffects contains binary equivalent of 1. Even if I do byte by byte comparison same problem occurs. What does _ltoa exactly perform? //--------------------------------------------------------------------- for(int i=0; i <16; i++) { _ltoa(i, binEffects, 2); if(strcmp((char *)binEffects, (char *)m_Effects) == 0) return i; } //--------------------------------------------------------------------- Thanks, Kranti

    C / C++ / MFC data-structures help question
  • Login

  • Don't have an account? Register

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