Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: How create table in SQL Server using C# and data from Excel. Pin
OriginalGriff15-Mar-14 4:48
mveOriginalGriff15-Mar-14 4:48 
AnswerRe: How create table in SQL Server using C# and data from Excel. Pin
Maciej Los15-Mar-14 6:43
mveMaciej Los15-Mar-14 6:43 
GeneralRe: How create table in SQL Server using C# and data from Excel. Pin
OriginalGriff16-Mar-14 0:05
mveOriginalGriff16-Mar-14 0:05 
GeneralW:Re: How create table in SQL Server using C# and data from Excel. Pin
Maciej Los16-Mar-14 0:14
mveMaciej Los16-Mar-14 0:14 
GeneralRe: How create table in SQL Server using C# and data from Excel. Pin
jschell17-Mar-14 8:34
jschell17-Mar-14 8:34 
GeneralRe: How create table in SQL Server using C# and data from Excel. Pin
OriginalGriff17-Mar-14 9:03
mveOriginalGriff17-Mar-14 9:03 
GeneralRe: How create table in SQL Server using C# and data from Excel. Pin
jschell18-Mar-14 8:07
jschell18-Mar-14 8:07 
GeneralRe: How create table in SQL Server using C# and data from Excel. Pin
OriginalGriff18-Mar-14 9:08
mveOriginalGriff18-Mar-14 9:08 
Not too bad, really.
The fields sizes (or at least, safe field sizes) can be inferred from the datatypes Excel returns - have a look at the code at the bottom of the link in my original post, it works pretty well.
The names can be retrieved as the column names from SQL - and nearly everybody uses those!
You can't assign primary keys automatically - excel doesn't have the concept - so the table is going to need some manual post processing. To be expected I guess! Exactly the same with indexes and foreign key relationships etc. - again Excel doesn't know what they are.

But for getting the basic structure right, and filling it in, then transferring a working structure complete with sample data it's not a bad idea, and could well be a lot easier than the equivalent in SSMS (which tends to annoy me a lot more than it should if I tweak my data when I'm designing data storage Laugh | :laugh: )
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

QuestionIEnumerable and disposal Pin
Rob Philpott14-Mar-14 0:31
Rob Philpott14-Mar-14 0:31 
AnswerRe: IEnumerable and disposal Pin
Richard Deeming14-Mar-14 2:06
mveRichard Deeming14-Mar-14 2:06 
GeneralRe: IEnumerable and disposal Pin
Rob Philpott14-Mar-14 2:27
Rob Philpott14-Mar-14 2:27 
GeneralRe: IEnumerable and disposal Pin
Simon_Whale14-Mar-14 2:30
Simon_Whale14-Mar-14 2:30 
GeneralRe: IEnumerable and disposal Pin
Simon_Whale14-Mar-14 2:29
Simon_Whale14-Mar-14 2:29 
AnswerRe: IEnumerable and disposal Pin
jschell14-Mar-14 11:57
jschell14-Mar-14 11:57 
QuestionSharepoint Gridview Pin
DipsMak13-Mar-14 23:21
professionalDipsMak13-Mar-14 23:21 
AnswerRe: Sharepoint Gridview Pin
Richard MacCutchan14-Mar-14 0:21
mveRichard MacCutchan14-Mar-14 0:21 
AnswerRe: Sharepoint Gridview Pin
DipsMak14-Mar-14 0:35
professionalDipsMak14-Mar-14 0:35 
GeneralRe: Sharepoint Gridview Pin
Richard MacCutchan14-Mar-14 1:35
mveRichard MacCutchan14-Mar-14 1:35 
Questionhow to have Pin
jojoba201113-Mar-14 19:14
jojoba201113-Mar-14 19:14 
AnswerRe: how to have Pin
BillWoodruff13-Mar-14 23:00
professionalBillWoodruff13-Mar-14 23:00 
AnswerRe: how to have Pin
Pete O'Hanlon13-Mar-14 23:11
mvePete O'Hanlon13-Mar-14 23:11 
QuestionRe: how to have Pin
jojoba201113-Mar-14 23:23
jojoba201113-Mar-14 23:23 
AnswerRe: how to have Pin
Eddy Vluggen13-Mar-14 23:30
professionalEddy Vluggen13-Mar-14 23:30 
AnswerRe: how to have Pin
Pete O'Hanlon13-Mar-14 23:57
mvePete O'Hanlon13-Mar-14 23:57 
AnswerRe: how to have Pin
Ravi Bhavnani14-Mar-14 6:41
professionalRavi Bhavnani14-Mar-14 6:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.