How to convert Any type file (bmp,Jpg,jpeg etc...)to binary or blob file to store it in sql 2005.
User 4510968
Posts
-
Converting Image file to binary file -
Storing Image file in sql 2005I tried to store the picture present in the MY Picture location of my system but unable to do so Qurey CREATE TABLE StockGifs (StockGifID int NOT NULL, Gif varbinary(max) NOT NULL) INSERT StockGifs (StockGifID, Gif) SELECT 1, BulkColumn FROM OPENROWSET (BULK 'C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills',SINGLE_BLOB) AS x Error Message :Msg 4860, Level 16, State 1, Line 1 Cannot bulk load. The file "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills" does not exist. Let me know what is the change need to be done If the location alone Can be stored then how to convert a jpeg file to binary file. Thanks in Advance, Praveen Arokiam
-
Storing My picture file in databaseI tried to store the picture present in the MY Picture location of my system but unable to do so Qurey CREATE TABLE StockGifs (StockGifID int NOT NULL, Gif varbinary(max) NOT NULL) INSERT StockGifs (StockGifID, Gif) SELECT 1, BulkColumn FROM OPENROWSET (BULK 'C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills',SINGLE_BLOB) AS x Error Message :Msg 4860, Level 16, State 1, Line 1 Cannot bulk load. The file "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Bluehills" does not exist. Let me know what is the change need to be done Thanks in Advance, Praveen Arokiam
-
Edit and Delete option with gridviewHello Friends, How to convert a bound field to template field in vb .net window application In website there exist a link to convert bound field to template field. Thanks In Advance Praveen
-
Dropdown box display issue in vb .netHello friends I have two radio buttons view and insert the view radio button display dropdown box, the dropdown box display the records retrieved from the database and displayed. (i) The first index is empty and the rest of the index is filled with the retrieved data i need the data to be displayed starting the first index. (ii) When i switch between the view and insert radio button and back to view radio button the data in the dropdown box is doubled for each of the above mentioned cycle Code: ----- Public Class Form1 Dim Conn As SqlConnection Dim Cmd As SqlCommand Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Conn = New SqlConnection Cmd = New SqlCommand Conn.ConnectionString = "Data Source=PERSONAL-A0CC22\SQLEXPRESS;Initial Catalog=personal;Integrated Security=True" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If (StudentId.Text = "" Or Fname.Text = "" Or Lname.Text = "" Or Address.Text = "" Or Mobile.Text = "" Or EmailId.Text = "") Then Label1.Text = "Fill In All The Fields" Label1.Visible = True Else Conn.Open() Cmd = Conn.CreateCommand() Cmd.CommandText = "Insert into student values('" + StudentId.Text + "', '" + Fname.Text + "', '" + Lname.Text + "', '" + Address.Text + "', '" + Mobile.Text + "', '" + EmailId.Text + "')" Cmd.ExecuteNonQuery() StudentId.Text = "" Fname.Text = "" Lname.Text = "" Address.Text = "" Mobile.Text = "" EmailId.Text = "" Label1.Visible = True Label1.Text = "Data Have Been Stored Sucessfully" Conn.Close() End If End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged TStudentId.Visible = True StudentId.Visible = False Button1.Visible = False Button2.Visible = True Button3.Visible = True Dim i As Integer Dim da As New SqlDataAdapter Dim ds As New DataSet Dim dt As New DataTable Conn.Open() Cmd = Conn.CreateCommand Cmd.CommandText = "Select StudentId from Student" da.SelectCommand = Cmd da.Fill(ds, "Student") dt = ds.Tables("Stude
-
Maintain whitespace between stringsThanks binjafar It is simple and effective Regards Praveen
-
Maintain whitespace between stringsHello friends, I tried converting lower case char to upper case and vice versa it works fine with the following code Dim abc As String Dim xyz As String = String.Empty Dim a As Char Console.WriteLine("Enter The String") abc = Console.ReadLine() For Each a In abc Dim b As Char If Asc(a) > 64 And Asc(a) < 91 Then b = Chr(Asc(a) + 32) ElseIf Asc(a) > 96 And Asc(a) < 123 Then b = Chr(Asc(a) - 32) End If xyz = xyz + b Next Console.WriteLine(xyz) Console.ReadLine() case 1 Input : ABCdef Output: abcDEF case 2 Input :ABC def GHI Output:abccDEFFFghi Desired Output:abc DEF ghi The issue is maintaining the whitespace between the strings, with the current code the the whitespaces are replaced by the previous charcter in the output. I like the whitespaces between the strings to be maintained . Thanks In Advance Praveen
-
accept a string and convert the case of the characters [modified]Hello Friends, I like to accept a string and convert the case of the characters using vb .net eg Input String : aBcDE Output String : AbCde depanding on the user selection Thanks In Advance Praveen
modified on Wednesday, May 27, 2009 5:17 PM
-
passing javascript variable to php file without page refreshvar clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen
-
treeview creation [modified]hello friends, 1.I like to create a dynamic tree view taking data from database. I browsed through net but all the sites have them as controls or their own classes. I like create without components using PHP javascript and ajax. 2.I also like to get values from database when clicking on tree node and place it on a dropdown box without posting it to the server(i,e using ajax). Thanks in advance, praveen
modified on Saturday, November 8, 2008 1:52 PM
-
Import Excel Sheet Data to Gridviewhi friends, I am trying to Import Excel Sheet Data to Gridview i used oledb connection to do this. my Connection string goes like this string strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" E:\\test.xsl;Jet OLEDB:Max Buffer Size=256;Extended Properties=Excel 8.0;HDR=NO;IMEX=1"; When i open the connection i get the following error Error code= 80004005 Error Description=Could not find installable ISAM Kindly help me out thanks, praveen
-
Export Gridview content to PDF using iTextsharphi friends, iam unable to to export gridview content to pdf using itextsharp. i surfed through the net but none of them worked for me if any of you provide me the code it would be a great help. Thanks in Advance, Praveen
-
export the excel sheet data into sql server in aspHi friends, how to export the excel sheet data into sql server in asp using ActiveX objects
-
GridView problemthanks for your reply
-
GridView problemHi friends i have an issue with grid view update functionality The problem is when i edit one of my grid view columns and click update The GridView1_RowUpdating method which contains the string textlastname = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox1")).Text; returns the old value in the column instead of the newly edited value. I need to get the newly edited value in the textlastname. TextBox1 is the id of the control Any help is highly appricated praveen
-
NUnit sql exceptionI have a dll which calls the procedure. The same method works for select stored procedure option.
-
NUnit sql exceptionhi friends, I have a sp for delete like this ALTER procedure [dbo].[pr_DeleteCampus] ( @campuscode smallint ) as delete from campus where campuscode = @campuscode but when i pass the parameter in the method and do NUit test like this public void deletecampus(int campuscode) { campuscode = 7; Assert.That(7, Is.Not.EqualTo(campuscode)); } It throws an error Sql Error Exception:Exception Procedure or Function sp_name expects parameter '@campuscode',which was not supplied.
-
NUnit Test Case IssueHi Anand, Thanks for the suggestion .But in my case the Stored procedure refer to both the tables and iam not priviledged to change the stored procedure. Thanks, praveen
-
NUnit Test Case IssueHi friends, I have created a NUnit plugin and testing giving the connection and stored procedure The tests works fine for sp refering single table under the condition the test method passes all the paramters in th stored procedure.Issue arises when my sp refers two tables and when both tables have common column name ERROR: Duplicate name(column name)occurs. Is there anyway to solve this issue?? Thanks In Advance, praveen
-
NUnit Test Case Not Working with Asp PageHi friends, i have created test case for checking the visibility and enable/disable functionality in a form.This works fine with the asp.net pages and controls my current project is with asp and the controls are html controls so the id attribute is missing. whenever i run the test it says NUnit.Extensions.Asp.WebAssertionException : couldn't find web form's 'id' attribute so can anyone tell me how to check the above mentioned functionality for html controls. Thanks In Advance, Praveen