I have a problem.
a section of a project I have created excel file to transfer data from the datagridview would. I then transferred the data after checking this information to the database I want to register. I assign the following code to add a record button.
string constr = "DSN=depo";
OdbcConnection con = new OdbcConnection(constr);
string firma = dataGridView2.SelectedRows.Cells["firma_ad"].ToString();
string miktar = dataGridView2.SelectedRows.Cells["miktar"].ToString();
for (int i = 0; i < dataGridView2.Rows.Count; i++)
OdbcCommand cmd_ec = new OdbcCommand();
OdbcDataAdapter adapter_ec = new OdbcDataAdapter();
string sql_ec = "insert into siparis (firma_ad,miktar)values ('" + firma + "','" + miktar + "')";
OdbcDataAdapter adpt_ec = new OdbcDataAdapter(sql_ec, con);
DataSet dsett_ec = new DataSet();
adpt_ec.Fill(dsett_ec, "Firmaya_göre_parçaları belirle");
But it also said there is an error in the code. excel file with this code when processing the same record over and over again until my yaıt line goes. Add the information in the same row is continuous.
Please let me know solution for my problem. How do I need to follow a path?
numbers don't have a base, it is only when they are converted to/from strings that a base applies.
have a look at Convert.ToInt32(String, Int32) and Convert.ToString(Int32, Int32)
[and similar for other types]
FFFF is already in the desired "format". You just need to choose the correct string format so you can see it in the desired representation.
Int32 i = 200;
String oct = Convert.ToString(i, 8); // gives "310"
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
I have developed a windows application. I put a rectangle picture as a background picture for my form. In that picture, outside the rectangle, it is colored red. In my form I set that color as the transparency color so it would show only that rectangle or any other shape as a form.
It works well in my own computer, but whenever I try to use it in another computer which also has the .Net framework installed there, the color does not hide and the transparency does not work. It shows both the rectangle and the background color. What should i do?
the picture is saved as BMP.
I'm using C# in a Visual studio. The application is written in .Net 2.0.
Which stores two values excellently. However, For values below 4 generally, numbers tend to overlap each other. IE, values of v1 = 0, v2 = 0; and v1 = 1, v2 = 1; tend to have the same digit value of db.
I was wondering there were any other methods of storing 2 values of data (bytes) within one single data (I'm using this to remove the necessity for multi-dimensional arrays and large collection objects).
1. this isn't C# code is it? hence: wrong forum.
2. db_p is a pointer pointing to a byte, yet you write at locations db_p+0, db_p+1, db_p+2, so you write past the item your pointer points to, which is either not allowed (C#) or cheating (C/C++).
3. Of course you can store 2 byte values in 3 bytes; it is plain stupid.
when I said "storing 2 byte values in 3 bytes is plain stupid." I can assure you it is, as that isn't compression at all, if anything it is expansion.
i'm not entirely experienced with the whole "storing two values in one"
Nobody is, as it can't be done. If you could store two byte values in one byte (i.e. store two byte values and then retrieve those values in any order and as often as you'd like), then what would keep you from doing that recursively: you could store the first two bytes of anything in 1, the next two bytes in another one, then combine those two bytes into a final byte; in the end you could store any amount of data, why not the entire Internet, into that one final byte?
We do get lunatics asking such questions regularly.
OTOH one of the replies you posted earlier in this thread seems to indicate an entirely different problem: storing one (or N) values for a 2D collection of cells. That can easily be solved in many ways:
1. with N two-dimensional arrays
2. with N one-dimensional arrays, and linearizing the index (as in index = x + y * width)
3. with a single one-dimensional array holding a little struct, which holds the different values for a single cell.
If that is what you need, then you should have made that clear from the start.
It just divided the byte in two parts, you could do the same with a short (then you could fit in two complete bytes) or an int (then you could fit in 2 complete shorts or 4 bytes)
But if you want a 2D -> 1D mapping it's better to use something "sane" such as x + y * width or if you don't want to use width you could use morton numbers to get a Z curve (just interleave the bits of your indices)
Well, I plan on having a 2D plain with cells ranging from 15x15 to up to 300x300, and rather than using a library collection storing both values, I would prefer to have both values point to an index within an array.
IE, R1C1 => Index 1, R1C2 => Index 2 etc etc..
I have read that these are possible but with no solutions.
Well, let's say each cell has a corresponding slot in an array containing information about the cell.
Each cell, when clicked or managed, will refer to the single slot in an array corresponding to the co-ordinates or row,column values.
If I was to use a method that relies on adding or multiplying x and y, there are chances that two cell coordinates may intersect and point to the same object. Therefore, I need the mathematical formula that produces an output using x and y to be a unique index key (not too large, otherwise the array would consume considerable amounts of memory), so that it may point to a slot in the array of cell information.
1,1 => Slot 1 in the array
1,2 => Slot 2 in the array
2,1 => Different slot than '1,2'.
I'm confused about what the value of 'width' should be. If width is the size of the cell, then I get conflicting types.
When I ran a debug loop doing (x + y * 16) I received conflicts at 17,1 17,2 etc etc.
And if I use 300 as the width, then the size of the array will be equal to 90,300 which is rediculously massive. Considering each slot in the array will store a structure of information, that could be quite a massive amount of memory usage?
Last Visit: 31-Dec-99 18:00 Last Update: 4-Oct-23 11:12