|
Hello Friends,
I need to import a
MSAccess Database to SQL server 2005 using C# code.
My question will be is it possible to do so?--I googled and am yet to find a satisfactory answer.So i thought i will post the question.
Also is it possible to import a txt file to MSAccess?
If yes can you guys give me any links please.
Thanking You all
|
|
|
|
|
TXT to Acess: google search for "Access import txt"
Access to SQL Server: google search for "sql server database import wizard"
If you only need to import the access database once, there's no reason to write a program to do it. If you need to import the database on a regular basis, then all you need to do is run the import wizard once, then when the wizard prompts you to "Save SSIS" package, save it as a local file. Then you can simply setup a scheduled job to run dtexec and import the database. If you need more control than that look at the SQL Data Compare tool from RedGate software www.red-gate.com[^].
Mark's blog: developMENTALmadness.blogspot.com
Funniest variable name:
lLongDong - spotted in legacy code, was used to determine how long a beep should be. - Dave Bacher
|
|
|
|
|
Thank you Mark,I will check this.
|
|
|
|
|
Hello
Can someone help me for the below problem,
I am working on a task of accessing VB6 Application's Method in c#.Net.
I dont know how to access and use methods of VB6 in asp.net.
Thanks in advance
sri
|
|
|
|
|
I guess you can add a reference as COM component. But this is not recommended. You can copy the code from VB6.0 and put it in a VB.NET project, compile and use that assembly, which will be managed code.
|
|
|
|
|
Thanks for your immediate reply.
Is there any chance to use reflection to meet my requirement?
if so, Can anyone please tell me how?
Thanks in Advance
sri
|
|
|
|
|
I think you will find you can get to some of them through the various Microsoft.VisualBasic namespaces.
|
|
|
|
|
I have three dates 1*,2*,3* ......
1* dateto = {4/9/2008 1:20:25 PM}// date time formate
range is like this
2* strdate=14-Feb-08 // string formate from datetime picker
3* enddate =14-Apr-08 // string formate from datetime picker
so now i have to check whether 1* lies between 2* and 3* or not..
can anybody suggest me what are the best ways to do...
i was trying to split the string and then compare first year then month then days
but that is going lengthy
so please help me here..
thanks in advance...
vikas da
|
|
|
|
|
The datetime picker returns a DateTime object, I thought. Just use the > operator to work out if your date is > the first and < the second.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello everyone,
To implement a service, I think we just need to derived from ServiceBase class, and implement some event handler function, like OnStart, OnStop, etc.
As described in the sample,
http://msdn2.microsoft.com/en-us/library/system.serviceprocess.servicebase(VS.80).aspx
What is the function of method InitializeComponent? I found it never called explicitly in the class SimpleService, nor there are any document from MSDN about this method. Any ideas?
thanks in advance,
George
|
|
|
|
|
George_George wrote: InitializeComponent
This is always where auto generated code lives, you should not modify it if you can help it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do we need to modify code for this method? Which party will invoke this method?
regards,
George
|
|
|
|
|
As Christian said, you don't need to modify it. Its just the designer code, so for example, if you drop a textBox on a form, all it's initialisations will go there such as it's size, location, name etc...
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Thanks Phannon,
Your reply is great! I think you mean this method will be maintained by designer (for example, if we add new Timer control, designer will add initialization code for Timer control in this method).
If we want any initialization code, we should put in constructor, right?
regards,
George
|
|
|
|
|
George_George wrote: Which party will invoke this method?
As CG said, it is auto generated. In windows application, controls will be initialized and added to the container in this method. This will be called from the constructor. In service you don't need this since you are not using any components like Timer etc. If you are using components like Timer, you can make use of this method to initialize the component and add it to the components collection which is IContainer instance. This helps the application to dispose the components used when service is getting disposed.
Hope this helps
|
|
|
|
|
|
George_George wrote: Do you think my understanding here is correct?
Yes.
George_George wrote: If we want any initialization code, we should put in constructor, right?
You can put the initialization code anywhere before the instance is used.
|
|
|
|
|
Cool, N a v a n e e t h!
Question answered.
regards,
George
|
|
|
|
|
hi,
for send Tab key >>> SendKeys.Send("\t");
but i want to know, how may I send BACK TAB which we usually use in form's textbox like "SHIFT+TAB"
SendKeys.Send(?????)
Thank you in advance
|
|
|
|
|
I guess for shift + tab its
Sendkeys.send("+{TAB}")
For Alt + tab its
Sendkeys.send("%{TAB}")
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
Hi Guys. Hope you all had a great weekend.
I want to impliment some further validation on a textbox in one of my applications. I currently only check that the .TextLength is 11 characters and if not to throw an error message. Now, I wan to take it one step further by checking that first character is a specific character say, A or B and if not to throw an error.
i.e I want to check that the first character in A0812345678 is an A or B. If not then then throw error.
Can somebody please help with this?
Below the check to see if it is 11characters long:
if (txtboxHolderRef.TextLength < 11 || txtboxHolderRef.TextLength > 11)
{
MessageBox.Show("HolderID should be 11 characters" , "Invalid Field Length",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
|
|
|
|
|
Urm... how about myString.StartsWith("some string"); ??
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Why would you throw an error ?
|| (txtBoxHolderRef[0] != 'A' && txtBoxHolderRef[0] != 'B')
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Why would you throw an error ?
Hi Christian. Because If they don't capture the data correctly I want to error rather than let them capture incorrect data. I need to process this data into the main system at a leter stage and getting the data correct when they capture it reduces any manual fixing later.
I will give your suggestion a go and see what happenes.
Thanks for the advice again.
|
|
|
|
|
I meant I'd show the user a message, not throw an error
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|