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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

Mattzimmerer

@Mattzimmerer
About
Posts
38
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL update query
    M Mattzimmerer

    Ok, Ill restrict my database to letters only... underscores shouldnt cause problems right?

    Database database announcement

  • SQL update query
    M Mattzimmerer

    I guess the parens were messing it up... thanks!

    Database database announcement

  • SQL update query
    M Mattzimmerer

    wait yes... i replaced that for some reason... i am updating a table

    UPDATE [dbo].[Pickups & Cars]

    SET ([Vehicle #] = @Vehicle_NO)

    WHERE ([Vehicle #] = @Vehicle_NO)

    this doesnt work...

    Database database announcement

  • SQL update query
    M Mattzimmerer

    This one should be easy :omg: ... I cant get a simple parametrized update query to function at all... This is a simplified version of what I am trying to do...

    UPDATE TheDatabase

    SET ([Vehicle #] = @NewVehNo)

    WHERE ([Vehicle #] = @OldVehNO)

    I dont enderstand why this is wrong... I suck at SQL lol... from MSDN i get the format:

    UPDATE ShoppingCart
    SET (BookId = @bookid, CustId = @custid, Quantity = @quantity)
    WHERE (BookId = @bookid AND CustId = @custid)

    Database database announcement

  • C# winform -> SQL server Trouble writing null values
    M Mattzimmerer

    duh.. yea I always seem to hit the wrong forum.. thanks for your help!!! =)

    Database database csharp sql-server sysadmin question

  • C# winform -> SQL server Trouble writing null values
    M Mattzimmerer

    I'm no professional, so I am aware that I may be missing out on a better method but here is what I am trying to do.

                int Market\_Value;
                    if (this.MarketValue.Text == "") Market\_Value = -1;
                    else Market\_Value = Int32.Parse(this.MarketValue.Text);
    
                TableAdapter.InsertQuery(Market\_Value == -1 ? Market\_Value : null)
    
                TableAdapter.Update(DataSet);
    

    *lots of code left out This doesn't compile because of the line : Market_Value == -1 ? Market_Value : null, its telling me that I cannot set an int to null Perhaps I could handle this in my InsertQuery? I'm super new to SQL so I cant see how... heres that function:

    INSERT INTO [dbo].[THE DATABASE]
    ([Market Value])

    VALUES (@Market_Value)

    I guess I could make the conditional statement in there somehow... but how? :confused: :sigh: .. need to learn more SQL :laugh: I just dont know, any insight into a better way would be greatly appreciated!

    Database database csharp sql-server sysadmin question

  • Windows forms application popup dialog?
    M Mattzimmerer

    "lol, i thought WF meant winform" yea reading my post it does really read like I think your wrong... I should sit back and reread my posts No, I meant to show that that was probably a misconception by me... sorry for coming off as rude... Once again I'm aware I am a noob, and my formal education is limited intro c++ (sorting, recursion, ect) I'm coding a GUI for an SQL database for my families business, and I would love professional input..., so once again I just want to reiterate, I KNOW you know more than me, throw me some direction. The reason I'm using Windows forms and not WPF is that I couldn't use the dataGridView object (at least as far as I know). What direction should I use to display SQL data with WPF with data-binding? I want the data to resemble excel for this particular database table.

    WPF winforms question

  • Windows forms application popup dialog?
    M Mattzimmerer

    Lol, yea probally, what should I do then?

    WPF winforms question

  • Windows forms application popup dialog?
    M Mattzimmerer

    yes SORRY.. lol, i thought WF meant winform... so maybey your confused about the forum? its name is (WPF / WCF / WF) besides, I found out how noob I was, I simply had my main form launch another form giving its self as a parameter... problem solved!!!

    WPF winforms question

  • DataGridView problem with cell coloring [modified]
    M Mattzimmerer

    Fixed my problem:

        private void Null\_check\_Click(object sender, EventArgs e)
        {
            for (int row = 0; row < this.dataGridView.RowCount-1; row++)
                for (int column = 0; column < this.dataGridView.ColumnCount; column++)
                    if (this.dataGridView.Rows\[row\].Cells\[column\].Value.ToString() == "")
                        this.dataGridView.Rows\[row\].Cells\[column\].Style.BackColor = Color.Red;
        }
    

    just needed sleep I guess...

    Database database help question

  • Windows forms application popup dialog?
    M Mattzimmerer

    I want to have my application pop up a dialog or another form do display a lot of check boxes and return the condition of the check boxes... I was just wondering how I could do this using "best practices". So far I think I'm looking at a child window of a custom dialog? Where should I go?

    WPF winforms question

  • DataGridView problem with cell coloring [modified]
    M Mattzimmerer

    Ohh, i should have changed that back. No I first tryed backcolor or w/e, which works find for populated cells... that was a purley desperate attempt.. THE PROBLEM PERSISTS!!!!

    Database database help question

  • DataGridView problem with cell coloring [modified]
    M Mattzimmerer

    I'm not sure if this is the best place to post this, but I'm retrieving a table form an SQL database and databinding the contents into a DataGridView. I have some code that searches the entire DataGridView and locates null values, and I intend to color the fields red so the user knows he needs to put something in.

        private void button1\_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(dataGridView.ColumnCount.ToString());
            for (int column = 0; column < 1; column++)//this.dataGridView.ColumnCount
            {
                for (int row = 0; row < this.dataGridView.RowCount; row++)
                {
                    //MessageBox.Show("Row,Column: "+row.ToString()+","+column.ToString());
                    if (this.dataGridView.Rows\[row\].Cells\[column\].Value == null)
                    {
                        this.dataGridView.Rows\[row\].Cells\[column\].Style.BackColor= Color.Red;               //EDITED: changed property to BackColor like I should have posted it...
                        //MessageBox.Show("Null at: " + row.ToString() + "," + column.ToString());
                    }
                }
            }
        }
    

    theres still some messageboxes in there that I used to figure this out... If I change the conditional statement to (this.dataGridView.Rows[row].Cells[column].Value != null) so that it searches for non null fields, it successfully colors the cells. I guess my problem has to do with the nullity (lol is that a word?) of my cells. I guess I should include how I am populating my dataGridView...:

        private void Form1\_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the '\_Vehicle\_EquipmentDataSet.\_Pickups\_\_\_Cars' table. You can move, or remove it, as needed.
            this.pickups\_\_\_CarsTableAdapter.Fill(this.\_Vehicle\_EquipmentDataSet.\_Pickups\_\_\_Cars);
        }
    

    that was auto generated =) Perhaps I can handle the null data when the list is populated? Thanks in advance!!!

    modified on Thursday, March 18, 2010 12:45 PM

    Database database help question

  • Reading a Float from memory
    M Mattzimmerer

    This worked great, thanks! Now i have a new trick lool, why didnt i think of that: cast it as a pointer of the type i know it is and then deference it =D...

    Managed C++/CLI data-structures performance help question

  • Reading a Float from memory
    M Mattzimmerer

    Wow I am burning my brain right here... I'm so very close to just saying screw it and writing some sort of conversion myself. First I'd love to know if there is an existing macro to do what I want to do... I have a char array: char OutputBuffer[1024] = {0}; (huge i know, but ill lower the size later ;P) that has a byte put into it... (78 AB 45 44) is a value I had at one time... as a float it means 790.67919921875 note!: this value has been read straight from memory The problem is I cant get this DWORD into a float for the life of me... Is there any existing macro? If not throw me a bone and tell me how i might convert this into a float from scratch...

    Managed C++/CLI data-structures performance help question

  • DeviceIoControl input buffer question
    M Mattzimmerer

    Yea, lol this stuff is pretty out there if you have only been exposed to userspace programming. Now onto assembly language!

    Hardware & Devices question help

  • DeviceIoControl input buffer question
    M Mattzimmerer

    Thanks sir, your tons of help. No it works now... maybe you should try helpful comments instead of (in my perception) being boastful. Surely you have asked for help to understand certain things... Obviously in not doing this professionally, its a side project in developing a game hacking tool! :-D

    Hardware & Devices question help

  • System::String ^ to LPCWSTR conversion?
    M Mattzimmerer

    worked great thank you. You know, I tried something like this, I just didnt make it a const, perhaps thats the reason it didnt work... Either that or I threw in some ANSII.. o well thanks man!

    Managed C++/CLI question

  • System::String ^ to LPCWSTR conversion?
    M Mattzimmerer

    Okay, you guys were a ton of help, but there is still something I am missing. Why dont I just show you what I am trying to do: I am trying to get a name from a windows forms textbox converted so that I can use it in FindWindowW() so that I can send a PID out to a driver this code is pretty messy atm, I usually clean it up after I get the proper way to do something. (imo lol)

    char* pProcName = (char*)(void*)Marshal::StringToHGlobalUni(this->ProcName->Text);

    wchar_t ProcNameWSTR, *pProcNameWSTR = &ProcNameWSTR;

    const wchar_t tester[11] = L"Calculator";

    int lengthmbc = mbtowc(pProcNameWSTR,pProcName,sizeof pProcName);

    unsigned long Returned;
    input bInput; //pre defined struct showing the members
    bInput.bytestoread;
    bInput.processid;
    bInput.startaddress;

    HWND windowHandle = FindWindowW(NULL, pProcNameWSTR);
    HWND windowHandle2 = FindWindowW(NULL, (LPCWSTR) &tester);
    if (windowHandle)
    MessageBox::Show("pProcNameWSTR success");//FAIL
    if (windowHandle2)
    MessageBox::Show("tester wchar_t success");//SUCCESS

    DWORD* processID = new DWORD;
    GetWindowThreadProcessId(windowHandle, processID);

    DeviceIoControl(
    hFile, // Device handle
    IOCTL_MZ_READMEMORY, // Code
    (LPVOID) &bInput, // Buffer TO driver
    sizeof bInput, // Size of InBuffer
    NULL, // Buffer FROM driver
    0, // Size of OutBuffer
    &Returned, // Bytes output
    (LPOVERLAPPED) NULL); // Overlapped struc

    the problem is that I cannot get the contents of ProcNameWSTR to match my tester[11] (the first if check fails and the second succeeds) any insight?

    Managed C++/CLI question

  • System::String ^ to LPCWSTR conversion?
    M Mattzimmerer

    Yea, I didnt expect it to work. But when you have no other ideas... lol thanks man! Ill give it a go!

    Managed C++/CLI 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