|
Hello All,
I have an application in VB.NET 2003, I want to import a delimiter text file into SQL Server. How do I go about doing this with vb.net code?
Please help me out!
regards
Mubashir
|
|
|
|
|
hi Mubashir,
its not clear what kind of process would u like to proceed. assuming you want to insert the data into table from file.try using BULK INSERT statement available on sql server2000. If you want to exec a select query stored in a text file there is no straight method to procede. i've manipulated some different approach for that,
assuming you have entere some "select * from Products" in a text file called test.txt. the steps involved are as,
Declare @cmd varchar(100)
Declare @sqlcmd varchar(2000)
set @cmd = 'type e:\test.txt'
CREATE TABLE #temptable (id int identity(1,1), string VARCHAR(4000))
Insert #temptable
exec master..xp_cmdshell @cmd
Declare @Max int, @Min int
select @sqlcmd=string from #temptable
Drop Table #temptable
Exec(@sqlcmd)
stay smart
|
|
|
|
|
can we add icon to mainmenu control in windows form? how?
thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... "
|
|
|
|
|
When you sy main menu, are you referring to a menustrip that you have placed on the form.
Posted by The ANZAC
|
|
|
|
|
yes, i am.. i dont know how to add icon to it.
|
|
|
|
|
i dont know about VB.NET.But in VB6 you need to use this API function:
Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
This is how you use it in VB6
Get the handle of the form's menu<br />
hMenu = GetMenu(Me.hWnd)<br />
'Get the handle of the form's submenu<br />
hSubMenu = GetSubMenu(hMenu, 0)<br />
<br />
'Change first item (index=0)<br />
picBitmaps(0).Picture = picBitmaps(0).Image<br />
lngID = GetMenuItemID(hSubMenu, 0)<br />
Call ModifyMenu(hMenu, lngID, MF_BITMAP, lngID, CLng(picBitmaps(0).Picture))<br />
i heard VB.NET has some API inbuilt.So look it up OK!
hope i helped
Gideon
|
|
|
|
|
ok, i will try it out, thankz for the info..
Ghost
|
|
|
|
|
I NEED HELP IN VB.NET CAN ANYONE HELP ME PLEASE
I NEED TO SEND A VIDEO FILE THROUGH THE INTERNET USING AN ADSL CONNECTIONS
CAN ANY ONE HELP ME WITH THAT
THX A LOT
YOUR,
MAY
|
|
|
|
|
First, read this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
HELLO,
i need some help please
i need to send a video file through the internet using an ADSL connection, can anyone help me please??
yours
may
|
|
|
|
|
The type of connection doesn't matter. What does matter is how your sending this file. Is your application a server, streaming the file to a Media Player, or are you trying to upload this file to a web server, FTP server, ...???
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'M TRYING TO UPLOAD THE FILE TO A FTP SERVER
|
|
|
|
|
You could have said that in your original post.
Is there some reason why your YELLING?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Under the .NET Framework 2.0, you can use the WebFtpRequest[^] class. The link is complete with examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thx
|
|
|
|
|
I'm using VB2005, how to make a string to contain double quotes?
and MORE IMPORTANTLY how to replace an existing string to contain double quotes?
eg. FROM visual basic TO vi"sua"l b"asi"c
I appreciate your help.
|
|
|
|
|
In a string, you specify double quotes by using pairs of them:
Dim str As String = "vi""sua""l b""asi""c"
pedestrian797 wrote: how to replace an existing string to contain double quotes?
Smae as you would any other String Replace operation.
' Replace all occurances of ' with "
newStr = str.Replace("'", """")
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
That's great! Thanks ...
|
|
|
|
|
Hi ,
I have been using SQLHelper.vb provided by Microsoft in DAAB
But looking at the long itrating code ..
IS IT ADVISABLE TO USE SQLHelper.VB FOR Applications With Heavy Data Access Rate
Thanx
Vola !!!!
|
|
|
|
|
Chintan Parikh wrote: IS IT ADVISABLE TO USE SQLHelper.VB FOR Applications With Heavy Data Access Rate
I've never had any problems with it, but then again, that all depends on your definition of "Heavy Data Access Rate"!
You could write a smaller test app against the library, simulating what you think your data transactions are going to be, then run your own benchmarks.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have written a program that requires a password to be created when it is first run, this is then encrypted and stored on the computer C:/Test.txt. the next time the program is run you enter your password, which is encrypted and compared against the encrypted password on file, and if they match you can use the program.
I don't think storing the encrypted password as C:/Test.txt is a good thing, so where is the best place to hide it away, and how is it done?
Any help, advice or interesting articles will be welcome.
A Clever Man Knows the Answers,
A Wise Man Knows Where to Find Them.
|
|
|
|
|
yea , like your subject says .go for the registry.You can put it HKEY_LoCALMACHINE\softwares\[software name]\pass
but this is the most obvious place some1 will have it stored.So i suggest having your encryption really strong because there is no place you can acutally "hid" your password.. there are crackers that can dissamble the program and fine out.
but hey i have got one really good sugesstion.. try using these API ->
<br />
Public Declare Function WriteProfileSection Lib "kernel32" Alias "WriteProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String) As Long<br />
Public Declare Function WriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As String, ByVal lpszString As String) As Long
they write stuff in .ini format into WIN.INI.I' bet very very few would guess u have it there.Also u should;nt have names that correspond to your app. So even if some one checks the win.ini file thy should NOT see ur app name or something thats on ur app in there!
good luck
Gideon
|
|
|
|
|
hi all...
i have a questions about VB.NET. actually, i'm the newbie in VB.NET. i a bit confuse about accesing the web that we create.
Question
1. can we access the web that we just created in the internet??
2. if yes, can everyone access the web that i've create??
3. i dont understand about how to get the 'server name' to make the
project. actually i've read about creating an XML Web service client
Project that about ASP.NET Web Aplication. i've confuse about the
address of the web server?? actually the default the project server is
"http://localhost". so what actually happen if i just use "http://localhost"?
can everyone access my web???
can someon plese me solve this problem...
i hope to hear from u all soon..
thanks..
areon25
|
|
|
|
|
areon25 wrote: 1. can we access the web that we just created in the internet??
That depends on what you mean by "access the web". But, generally, yes, VB.NET can get the any publicly available website as well as create them using ASP.NET technology.
areon25 wrote: 2. if yes, can everyone access the web that i've create??
Of course! So long as the website is publicly visible on the Internet. There are MANY hosting companies that support ASP.NET applications.
areon25 wrote: 3. i dont understand about how to get the 'server name' to make the
project. actually i've read about
OK. You've got some homework to do. Especially in how the Internet and web servers work, along with general IP networking.
The webserver address specifies the location of the IIS server that your going to develop your ASP.NET project on. It is HIGHLY recommended that you develop your site on an IIS server on your own network, then transfer the completed site to a hosting server.
Can anyone on the Internet see your website? Only if the machine that is hosting the site is visible on the Internet. Generally, this answer is no, unless you properly configure your network and machines and have them patched up and properly secured.
If you're asking these kinds of questions, I would HIGHLY suggest you DON'T do this. There are many security concerns with opening up your private network to the real world. You'll probably have your network attacked within hours and risk having your machines turned into zombies, if not wrecked, spamming the rest of the world for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
Seeing as there's no MS Office board, I thought I might try here.
Basically what I want to do is during setup is to check that all components of Microsoft Office have been installed and if not, launch Windows Installer to install the rest of the components. Doing this during setup is not a problem for me, it's just the checking of components of Microsoft Office that's the real difficulty.
|
|
|
|