I m student and develop a website. i want to know how images /pics and video and audio files are store in Sql server2005 database. and ya i want to store whole file not just its address.
i using asp page like uploadImage.aspx in that i put UploadFiles control now i m confuesd to storing Images so plese help me and give code or some good easy trick at my level
And once store image or video and audio file in sql database then after how i used in my asp.net page. which control i wish to used for this files so plese this also slove it. give also code or any easy trick for fullfil my task..
hi i am using database sqlserver,i am searching for varray concept like in oracle to store multiple values in a single column(as array column) like that shell i do in sql server 1.how to create array column in a table using sqlserver if possible how can i use select query for that
I have a table called Image1 and i have stored the image in SQL server 2005 with a feiled called picture
table name ---- Image1 field-- picture (data type image) please let me know the code step by step code how to Retrie Images from SqlServer in ASP .NET, please help me ....
can any one help me with the complete code step by step i mean my table name is Image1 and feild name is picture , please let me know the code with my feild name and in my table i have only picture feild and i have stored in binary format , please help me
lakshmi writes "I tried to insert in sqlserver using textcopy.exe. But it is not inserting. how to insert images in sqlserver? Pls reply it is most urgent for me."
I am having a problem with MMSQL BLOB with VB, Sorry to say I am new in Programming using VB 6 and MSSQL and I have never touch BLOB in my live.
I just wish anyone could give me any ideal, like, white pages, or manual on how do I insert BLOB data (Images) to MSSQL 2000 database using VB 6. I need to know exspecially the VB Code and the SQL Portion if you have a store procedure code for that it will be nice. :confused:
I use select @@identity to return @@identity from my store procedure,but I could not retrive it from my Visual basic code, like variable=oRS.fields.item(0).value, it always says item can not be found....
Hello,I would like to keep some values as session variables while the user is loged in, but i am missing some part of how to implement it.This is what I have:<script runat="server">
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)
Dim conn As SqlConnection Dim cmd As SqlCommand Dim cmdString As String = "SELECT users.username, users.password, users.FirstName, users.LastName, users.CompanyId, Company.CompanyName, users.SecurityLvl FROM users LEFT OUTER JOIN Company ON users.CompanyId = Company.CompanyId WHERE (users.password = @Password) AND (users.username = @Username)"
Hi Guys, I have this SqlDataSource, that counts some records and sets it in "NotStartedBugs". How do I retrive "NotStartedBugs" programmatically? <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT (SELECT COUNT(*) AS Expr1 FROM tickets WHERE (TicketType = 'Bug') AND (TicketStatus = 'Not Started')) AS NotStartedBugs"></asp:SqlDataSource>
Hello, inside of my SP i want to execute another SP, something like: EXEC [dbo].[Forum_DeleteBoard] @BoardID = @DelBoardID this function Forum_DeleteBoard returs one row with 3 columns as a table, how do i get the first column of that table into a variable so i can check if it was ok or not(it returns just one row with 3 columns). Columns it returns:QResult , Threads , Answers SELECT @isok = QResult FROM EXEC [dbo].[Forum_DeleteBoard] @BoardID = @DelBoardID ? or how do you get it? Patrick
hai everybody!!!! am developing one application in visual 2005..and sql server. so how to write the coding for searching one record from a database table according to the id..and to display it
hai everybody!!!!! am working wirh visual 2005 and sql server()asp.net).....so i need the coding in VB for searching one record from a database table according to the id..and want to display it.....
This is DataSet retriving code from IBUYSPY Events Module.
public DataSet GetEvents(int moduleId) {
// Create Instance of Connection and Command Object SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); SqlDataAdapter myCommand = new SqlDataAdapter("GetEvents", myConnection);
// Mark the Command as a SPROC myCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
// Add Parameters to SPROC SqlParameter parameterModuleId = new SqlParameter("@ModuleId", SqlDbType.Int, 4); parameterModuleId.Value = moduleId; myCommand.SelectCommand.Parameters.Add(parameterModuleId);
// Create and Fill the DataSet DataSet myDataSet = new DataSet(); myCommand.Fill(myDataSet);
// Return the DataSet return myDataSet; }
My Question is
1) Is this ideal way to retrive data? 2) Will it return connection back to pool?
Hi, I am new to using SQL. Currently, I'm using the following statemens to retrive a specific record from my MS Access DB via VB.net.
SELECT * FROM table_name WHERE Field_Name = Criteria
Can someone please tell me, after selecting this record, If I want to go to the FIRST, or NEXT or PREVIOUS of the record just retrived or the LAST record. Can someone please tell me how can write the SQL statment to achieve this ?
Code Block SELECT tce.TimeCardID, tce.TimeCardExpenseID, tc.DateCreated, e.LoginID, e.FirstName + ' ' + e.LastName AS FullName, tce.ExpenseAmount, tce.ExpenseDescription, op.ProjectName, op.ProjectDescription, ec.ExpenseCode FROM OPS_TimeCards tc JOIN OPS_Employees e ON e.EmployeeID = tc.EmployeeID JOIN OPS_TimeCardExpenses tce ON tc.TimeCardID = tce.TimeCardID Join OPS_Projects op ON op.ProjectID = tce.ProjectID Join OPS_ExpenseCodes ec ON ec.ExpenseCodeID = tce.ExpenseCodeID WHERE e.LoginID = 'jross' ORDER BY tc.DateCreated DESC
this query returns me the correct data....but i need to tweak the query so it does not duplicate rows....My tce.TimeCardID is a PK in its table and so is TimeCardExpenseID...but the problem is U can have many TimeCardExpenseID's for one timecard so my results look like
TimeCardID TimeCardExpenseID 1 2 1 3 1 4
I want my query to return the "TimeCardID" but i just want that one ID to represent all the TimeCardExpenseID's...but i can not get it to work and have no clue....
hi I have used the following code (mostly created by MSDN) to retrive a binary field from SQL database. it works but I have extra space between characters. for example if I save a text file with "Hello world" text, after retriving I have it like "H e l l o w o r l d". what is the problem?????? I am really looking forward your answers private void retrive() { public void a() { SqlConnection connection = new SqlConnection("Some Connection string"); SqlCommand command = new SqlCommand("Select * from temp", connection); // Writes the BLOB to a file FileStream stream; // Streams the BLOB to the FileStream object. BinaryWriter writer; // Size of the BLOB buffer. int bufferSize = 50; // The BLOB byte[] buffer to be filled by GetBytes. byte[] outByte = new byte[bufferSize]; // The bytes returned from GetBytes. long retval; // The starting position in the BLOB output. long startIndex = 0; // Open the connection and read data into the DataReader. connection.Open(); SqlDataReader reader = command.ExecuteReader(CommandBehavior.SequentialAccess); while (reader.Read()) { // Create a file to hold the output. stream = new FileStream( "C:\file.txt", FileMode.OpenOrCreate, FileAccess.Write); writer = new BinaryWriter(stream); // Reset the starting byte for the new BLOB. startIndex = 0; // Read bytes into outByte[] and retain the number of bytes returned. retval = reader.GetBytes(0, startIndex, outByte, 0, bufferSize); // Continue while there are bytes beyond the size of the buffer. while (retval == bufferSize) { writer.Write(outByte); writer.Flush(); // Reposition start index to end of last buffer and fill buffer. startIndex += bufferSize; retval = reader.GetBytes(0, startIndex, outByte, 0, bufferSize); } // Write the remaining buffer. if (retval != 0) writer.Write(outByte, 0, (int)retval - 1); writer.Flush(); // Close the output file. writer.Close(); stream.Close(); } // Close the reader and the connection. reader.Close(); connection.Close(); } }
hai In my web application i want to bind data from sql 2005 to ultrawebgrid, when i use source code dim cmdselect as sqlcommand dim cmdstring as string cmdstring="select name, datefieldname from tablename" cmdselect=new sqlcommand(cmdstring,connectionstring) connectionstring.open() ultrawebgrid1.datasource=cmdselect.executenonquery() ultrawebgrid1.databind() connectionstring.close() ----- when i execute above coding i am geting date and time displayed there, but i want to display date alone --my datefield datatype is datetime - i am using sql 2005,(vs2005-vb/asp.net) please help me thanks in advance
I have a locally installed MS SQL server 2000. I am trying to retrieve the contents of the table onto a datagrid. But when I use the user name and password, It gives the following errorSystem.Data.SqlClient.SqlException: Login failed for user 'aroop'. Reason: Not associated with a trusted SQL Server connection. string connectionString = "server=(local); uid=aroop; pwd=abcdef; database=mydb"; string commandString = "select * from mytable"; SqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, connectionString); DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet); dgEmployees.DataSource = dataSet; dgEmployees.DataBind();Can someone please let me know what to do about this?