|
Dear Friend,
I am doing a research porject about Images. Therefore
I would like to know from you, how to generate an
Image using a ByteCode of an origional image or from a
HexaView of an origional Image. What I need is, a
Java or C# function or DLL to regenarate a copy of an
Image. I can convert a given Image(any format) to the
HexView or to the ByteCode. Hence I need to regenarate
a copy of that Image using the extracted ByteCode or
HexView.
I am waiting for an imediate reply from YOu.
Pls Help me out.
mdkrishan@yahoo.com
md_kpnp@mail.com
mdkrishan@gmail.com
|
|
|
|
|
Hello.
I have an application that uses dataadapters to fill some datasets, and it works just fine, but sometimes it crashes and i get to following error: "System.NullReferenceException: Object not set to an instance of an object".
The whole error is:
Severity=5,OccurenceTime=10.06.2005 16:23:02,Class=Data.DbManager,Method=FillTable,Message=System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.DataTable.LoadDataRow(Object[] values, Boolean fAcceptChanges)
at System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges)
at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDataReader dataReader)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Data.DbManager.FillTable(DataTable table, String commandText),Stack= at System.Data.DataTable.LoadDataRow(Object[] values, Boolean fAcceptChanges)
at System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges)
at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDataReader dataReader)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Data.DbManager.FillTable(DataTable table, String commandText)
Can u please help me? It's very unpseting that the application works and then suddenly crashes
Thanks.
MetalSandman.
|
|
|
|
|
can you post the specific code section where the exception is thrown plz ?
|
|
|
|
|
i get the error with this fill:
"IDbCommand command = DbManager.GetCommandWithDefaultOpenConnection(commandText);
((SqlDataAdapter)GetDataAdapter(command)).Fill(table);
command.Connection.Close();"
the GetDataAdapter function:
"IDbDataAdapter dataAdapter = null;
dataAdapter = new SqlDataAdapter((SqlCommand)command);"
the getCommandWithDefaultOpenConnection function:
"IDbCommand command = null;
command = new SqlCommand();
command.CommandText = commandText;
command.Connection = GetNewOpenDefaultConnection();"
hope this helps.
MetalSandman
|
|
|
|
|
Somehwere along this line of code, you're attempting to use an object that wasn't created. For instance:
IDbCommand command = DbManager.GetCommandWithDefaultOpenConnection(commandText);
((SqlDataAdapter)GetDataAdapter(command)).Fill(table);
command.Connection.Close();
Did .GetCommandWithDefaultOpenConnection(commandText) actually return an object? You don't know because you didn't check for it before you attempted to use its .Fill(table) method.
Another couple questions would be, does that table parameter represent an actual object or is it possible that it it a Null reference. Does the GetDataAdapter(command) method call actually return an object?
You're making all these calls to create objects, but your code is assuming that they all worked. It's never checking the return values of any of these calls, and therefore, you have a failure (NullReferenceException) that you cannot easily trace down.
Oh, as a side-bar, you can only have one active DataAdapter per Connection object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks 4 the advice. i will try to check the returned objects.
|
|
|
|
|
Hi,
I have a datagrid with several columns. Some columns are filled from a datasource others have to be manually typed. Let's say i have columns A, B and C.
When the user fills cells for column A & B i want to use that info to calculate the value in cell C for that given row.
Is there a way to directly control a specific cell in a datagrid in fill it with the desired value.
|
|
|
|
|
You can define an expression for a column, enabling it to contain a value calculated from other column values in the same row or from the column values of multiple rows in the table. To define the expression to be evaluated, use the Expression property of the target column, and use the ColumnName property to refer to other columns in the expression. The DataType for the expression column must be appropriate for the value the expression will return.
<br />
workTable.Columns.Add("Total", typeof(Double));<br />
workTable.Columns.Add("SalesTax", typeof(Double), "Total * 0.086");
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hi Guys,
Is there anyway I can export my excell file (dynamic) into our SQL server database using c#? All our data from one our system will be generated from excell file every month.
Links or ideas is most welcome! Thanks in advance.
/dabuskol
PS: Can I run the DTS in c#?
|
|
|
|
|
Have you consider using a DTS in SQL Server
Carlos Sánchez Pérez
carlos@hotmail.com
Mathesis Consultores
Cd. Obregon, Sonora, Mexico
|
|
|
|
|
Hi
I have a table (named information) that contains columns with the names (1,2,3,4,5,6,7,8,...210)
I entered a loop from i=1 to i=210 and inside the loop I write the following SQL statement:
string an = "SELECT " + i.ToString() + " FROM information WHERE id = '" + s.Id + "';";
I should get the string contained in the column named i but what I get is i itself (
Whay would be the problem
|
|
|
|
|
Well, you're asking it to select 1 from information where ID = s.ID. What did you expect ? Your columns are NAMED 1,2,3,4,5,6, up to 210 ? Sounds like God is punishing you for a terrible design....
Try this:
"SELECT i." + i.ToString() + " FROM information i WHERE id = '" + s.Id + "';";
Although I don't get why you need to kill performance by making 210 SQL calls instead of one ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It did not work.
exception error said: invalid use of "." in SQL statement!!!
|
|
|
|
|
Still because of the stupid column names. Try [i." + i.ToString() "]
etc. If you put the parameter in [], it may force it to accept it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks it worked
it is not stupid :/
I am storing the answers of student each answer in one column as my istructor said.
But, would u tell me the idea of ur solution and why mine is wrong?
|
|
|
|
|
mhmo wrote:
I am storing the answers of student each answer in one column as my istructor said.
OK - that's fine, if that's how you want to do it. I just wouldn't name them 1,2,3,4,5. I'd name them something so that anyone who read the database would know what they were. Personally, I would not store them in this format at all, unless you want to use SQL to tell you who got what answer right, but that would be hard unless the questions are maths or multiple choice.
mhmo wrote:
But, would u tell me the idea of ur solution and why mine is wrong?
Yours is wrong because it makes a round trip to the database for every answer. If you do a SELECT * from information where blah blah, then you can get back a dataRow which you can access locally to get the individual values, without making a round trip to the server every time.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
it will enhance the performance if I used the * format?
//The answers are mulipchoice
|
|
|
|
|
By a factor of 210. Instead of 210 calls to the database, you make one, and then get all the values back into a local object that you can step through to find the replies.
If the questions are multiple choice, and there are always 210 questions, then there are reasons to put an answer per column, in terms of being able to query the data. I'd just name them Answer1, Answer2 or something, so I didn't need to use [] all the time.
Actually, even then I think I'd be more inclined to do a table that contains the student ID, the question ID and the answer in three columns, which would allow me to have as many or as few questions as I liked, still search the database for answers, and not waste any space.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The idea is that we will use Crystal Reports to print the answers of each or a specific student in a specific format.
But why we should use []?!!
|
|
|
|
|
mhmo wrote:
The idea is that we will use Crystal Reports to print the answers of each or a specific student in a specific format.
OK - either way, I think the data format I've specified is better, but I'm not familiar with Crystal Reports. If it needs all the values to be in one row, that would just be crap though.
mhmo wrote:
But why we should use []?!!
Because a number on it's own is a reserved value, it's not really an acceptable column name. The [] tells it we used bad column names, and asks it to live with it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
>... but I'm not familiar with Crystal Reports. If it needs all the values to be in one row, that would just be crap though.
You can pivot data in Crystal, but it's still crap.
|
|
|
|
|
Just a hint:
Read up on how others have structured a multi-choice test in a database. Your table schema is plain crazy!
|
|
|
|
|
Ok
Would u give a link for some
thanks
|
|
|
|
|
|