Skip to main content

Dear All,

 

By seeing my problem, It's really make me confuse, beside i'm still beginner in k2.

 

import excel file to database sql server by smartform.

 

 

if using windows from vb.net, i can make import excel file to database sql server.

 

But never using k2 smartforms.

 

this is what i think so far :

1. make a code in vb.net and request a parameter string path

2. build and get .dll

3. make the .dll become a smartobject (but honestly i don't know how)

4. make a simple view that contain file attachment

5. pass the file path of the file attachment to the smartobject

 

 

 

so far i try make view first and adding control File Attachment in a view, and after that i still don't know where i can get "the path files", i transfer the files name into a textbox, it is only contain the file name only, no path

 

14176iFF1135A748FB3FA9.jpg

 

and my question is :

is what i think (the 5 step above) is right?, if one of the step is wrong please correct me.. or is there any other way beside of what i think above?

 

 

 

Any help would be appreciated.

 

Thanks before :)

 

 

Best Regards,

 

Musa

Are you trying to insert the data from the excel file into a DB table? or just trying to have the files stored in the DB?


Dear Kevin,

 

i'm trying to insert the data excel into data sql DB table (not the file excel), sorry for my title mistake.


Well it depends on what your are trying to do. If you have a set number of spread sheets you can jsut migrate them to SQL.  in that case I know that in SQL Management Studio, From Object Explorer Window, right click on the database which you want to import table into. Select Tasks -> Import Data. This is a simple tool and allows you to 'map' the incoming data into appropriate table. You can do this for your excel files to quckly make a table then use a SMO to use that data. If you wanted to automate the proccess you would make a stored proc to read the files I would then, then have the proc called by a SMO 


Dear Kevin,

 

Thanks again for your reply kevin. it was a solution 🙂.

 

but acctually i need more than that.

 

the problem is the path of the excel file it self is not a "static" path. coz here i want to make an open dialog from so that user can looking for the excel file in their directory (whatever where it is), so i need "dynamic " path here.

 

This is the problem that i face till now.

 

well i think i just need to maintain for my another post about smartform control that can get path for next.

 

Many Thanks for your reply.

 

Regards,

 

Musa


Reply