View Complete Post
Hello All experts there,
I need to insert some csv file data into sql server 2008. but there are multiple tables created in sql server and I need to check some conditions before data insertion and based on the condition value, sql script should insert the data in to specific table.
in other words I need to insert data from one csv file to different tables based on some condition.
is it possible? if yes then can anyone please give me an idea on how can we do that?
Thanks in advance
guys, i am new to sql development
my question is how do i import data from an excel table,
i was trying to do it via a query and just paste the values, but received a syntax error. thanks
data structure is:
I have TBL_PRODUCT table : ProductID, ProductName, CategoryID, Image.
I can insert data to table :
public ActionResult Create(tbl_products products)
I can upload image file too
public ActionResult UpHinh(HttpPostedFileBase fileImg)
var fileName = Path.GetFileName(fileImg.FileName);
fileImg.SaveAs(Server.MapPath("/Content/Images/" + fileName));
Help me. Thanks
I've been working on a code that allows users to upload images (jpgs) as an optional field. Alhough the uploading works, I'm struggling when the user doesn't have an image to upload. I can't seem to find the way to NOT insert binary data into my database, I just want an NULL value when there is no image. I get this error message: ...expects parameter @Image, which was not supplied.
Here is the code:
I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where
i can just call the method with my SQL Query
Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");
Plz Post the link if there is any open source !
I am trying to insert data to Excel Document using OLEDB as follows:-
sql = "Insert into [MyFirstSheet$] (" + Title1 + "," +Title2 + "," + Title3 + ")
values('" + Value1 + "','" + Value2 + "','" + Value2 + "')";
myCommand.CommandText = sql;
But, the Title1 ,Title2, Title3 are in the 3rd row of the Excel Document. So, the data is not inserted.
SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.
Alok Mehta and Ricardo Rodriguez
MSDN Magazine May 2003
I want to use gridview and bind the data and after i want insert the data in database using jquery,
below the link i got for delete
but i want the sample example for insert row from gridivew and add the database.
I am getting error in here
987 is where i put clientname.text
Dim objCmd As New SqlCommand("Create Table " + clientname.Text + "(name
Varchar(50), event Varchar(50), date1 datetime, username Varchar(50),
password Varchar(50), " + strCommandText + ")", objConn) objCmd.CommandType = CommandType.Text objCmd.ExecuteNonQuery()
Dim objConn2 As New SqlConnection("Data
Catalog=mrpoteat; User ID=xxxxx; Password=xxxxxx;") objConn2.Open() Dim strCommandText2 As String = "" For index2 = 1 To Attachments1.Items.Count Step 1 If String.IsNullOrEmpty(strCommandText2) Then strCommandText = "@pic" + index2.ToString() &
is it possible to create a custom list in sharepoint designer to enter a vacation request and using a work flow that goes to the HR department. but when the HR department approve the request the HR can store these requested data into another database?
what i mean is, the employee fill a form in to request some vacation days using a custom list in my wss3 site. i assume that these data will be stored in the WSS_content database. now when the HR department get this filled form they have to store the data
of the form in to a database but not in the WSS_Content database.
is this possible?
My requirement is that i upload an excel file then i need to validate that data.
1. Uploading file using using upload control saving binary in SqlServer
2. Then i am creating file from binary data on Sql Server using below command and then using OPENROWSET to dump data to Sql table
3. Then reading Sql Table row wise and validating data.
Alter Procedure spUploadExcelFile
Declare @VarBin varbinary(max)
Declare @FileName varchar(100)
DECLARE @sql nvarchar(MAX)
DECLARE @errMsg nvarchar(MAX)
DECLARE @ObjectReturn INT
DECLARE @ErrorSource VARCHAR(255)
DECLARE @ErrorDesc VARCHAR(255)
DECLARE @ObjectToken INT
Select @VarBin = Content , @FileName = [FileName] from MultilangBinaryData Where PKID = @PKID
SET @FileName = 'C:\' + @FileName
EXEC sp_OACreate 'ADODB.Stream' @ObjectToken OUTPUT
EXEC sp_OASetProperty @ObjectToken, 'Type', 1
EXEC sp_OAMethod @ObjectToken, 'Open'
EXEC sp_OAMethod @ObjectToken, 'Write', NULL, @VarBin
EXEC sp_OAMethod @ObjectToken, 'SaveToFile', NULL, @FileName, 2
EXEC sp_OAMethod @ObjectToken, 'Close'
EXEC sp_OADestroy @ObjectToken
SET @sql = 'INSERT INTO dbo.UserBulkData SELECT 0,NULL,'+ @BatchI