Reading the path of a file in C# - URGENT!!
-
Hi, i have tried this line in my project so i can get the path of the images for storing them later in the SQL table but it did not work: byte[] imageData = ReadFile(txtImagePath.Text); I get an error 'ReadFile' does not exist in the current context. In which class does this method belong? Thanks..
-
Hi, i have tried this line in my project so i can get the path of the images for storing them later in the SQL table but it did not work: byte[] imageData = ReadFile(txtImagePath.Text); I get an error 'ReadFile' does not exist in the current context. In which class does this method belong? Thanks..
Buy a book.
-
Hi, i have tried this line in my project so i can get the path of the images for storing them later in the SQL table but it did not work: byte[] imageData = ReadFile(txtImagePath.Text); I get an error 'ReadFile' does not exist in the current context. In which class does this method belong? Thanks..
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi, i have tried this line in my project so i can get the path of the images for storing them later in the SQL table but it did not work: byte[] imageData = ReadFile(txtImagePath.Text); I get an error 'ReadFile' does not exist in the current context. In which class does this method belong? Thanks..
Hi ReadFile is method man, but u miss that signature in ur class. check ur code
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Hi ReadFile is method man, but u miss that signature in ur class. check ur code
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
I know it's a method and i'm asking if it's a predefined method in one of the imported namespaces and if yes which one?
-
I know it's a method and i'm asking if it's a predefined method in one of the imported namespaces and if yes which one?
hey there no method like that code snippet.but i think u may be in incorrect way. please tell me wat are try to do? if u want to read file please check File class in the .net 2.0 see here http://msdn2.microsoft.com/en-us/library/system.io.file_methods.aspx[^] thanks
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
hey there no method like that code snippet.but i think u may be in incorrect way. please tell me wat are try to do? if u want to read file please check File class in the .net 2.0 see here http://msdn2.microsoft.com/en-us/library/system.io.file_methods.aspx[^] thanks
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
I skipped the ReadFile method and used something else instead. This is my code so far: try { byte[] image = new byte[4]; string qry = "insert into ITEM(item_picture) values(@OriginalPath)"; command = new SqlCommand(qry,connection); command.Parameters.Add(new SqlParameter("@OriginalPath","~/images/app1.jpg")); } finally { connection.Open(); command.ExecuteNonQuery(); connection.Close(); } I'm trying to execute this within a method every time i add a picture in the table. The table is called ITEM and the column with the type image is called item_picture. And the application root is ~/images/ where i have stored all the images. I get the following error: Operand type clash: nvarchar is incompatible with image Thanks