473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vb.net continuation

I am writing a vb.net program that needs to create a table in the same format
each time it creates a new table. This is a "ulility" program that I am going
to be using it for.
Right now I have keyed this large table into sql server 2000 and the
vb.net program I wrote loads all the columns appropriately. I have run sql
server 2000 with the "generate script" for me have have saved the sql server
2000 code that will create a table.

The start of the script looks like
"CREATE TABLE [dbo].[test_table] ([field1] [varchar] (40) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[field] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

The end of the table looks like:
[WC_USE.22] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,[WC_PASSWORD.20] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , {
[MPLANNER] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

I would like to incorporate this code into the VB.net program. To to this I
need to put " (quotes) at the start of every line and I need to put " & _
at the end of every line.

Is there a way to have this completed for me without having to key this in
on every line? This would be similar to the "comment select lines" and
"uncomment selected lines" feature that the visual studio .net ide has.

Thanks!
May 30 '06 #1
3 3645
"Wendy Elizabeth" <We************@discussions.microsoft.com> schrieb:
I am writing a vb.net program that needs to create a table in the same
format
each time it creates a new table. This is a "ulility" program that I am
going
to be using it for.
Right now I have keyed this large table into sql server 2000 and the
vb.net program I wrote loads all the columns appropriately. I have run sql
server 2000 with the "generate script" for me have have saved the sql
server
2000 code that will create a table.

The start of the script looks like
"CREATE TABLE [dbo].[test_table] ([field1] [varchar] (40) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[field] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

The end of the table looks like:
[WC_USE.22] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,[WC_PASSWORD.20] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
, {
[MPLANNER] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

I would like to incorporate this code into the VB.net program. To to this
I
need to put " (quotes) at the start of every line and I need to put " &
_
at the end of every line.


If you are using VB 2005, choose "My Project" in the solution explorer,
click "Resources", add a new string resource, name it 'CommandStringStart',
and paste the start string into the resource. Then do the same for the end
string. Inside the source code you can refer to the strings as shown below:

\\\
Dim CommandString As String = _
My.Resources.CommandStringStart & _
... & _
My.Resources.CommandStringEnd
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 30 '06 #2
Herfried K. Wagner:

Thank you for answering my question. However, I should have mentioned that
I am using Visual studio.net 1.1 (2003 version). Can you tell me how I would
accomplish this task using Visual studio.net 1.1 instead?

Thanks!

"Herfried K. Wagner [MVP]" wrote:
"Wendy Elizabeth" <We************@discussions.microsoft.com> schrieb:
I am writing a vb.net program that needs to create a table in the same
format
each time it creates a new table. This is a "ulility" program that I am
going
to be using it for.
Right now I have keyed this large table into sql server 2000 and the
vb.net program I wrote loads all the columns appropriately. I have run sql
server 2000 with the "generate script" for me have have saved the sql
server
2000 code that will create a table.

The start of the script looks like
"CREATE TABLE [dbo].[test_table] ([field1] [varchar] (40) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[field] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

The end of the table looks like:
[WC_USE.22] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,[WC_PASSWORD.20] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
, {
[MPLANNER] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

I would like to incorporate this code into the VB.net program. To to this
I
need to put " (quotes) at the start of every line and I need to put " &
_
at the end of every line.


If you are using VB 2005, choose "My Project" in the solution explorer,
click "Resources", add a new string resource, name it 'CommandStringStart',
and paste the start string into the resource. Then do the same for the end
string. Inside the source code you can refer to the strings as shown below:

\\\
Dim CommandString As String = _
My.Resources.CommandStringStart & _
... & _
My.Resources.CommandStringEnd
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 30 '06 #3
Hi Wendy,

Use the following function to obtain a byte array from a resource,
remember that you need to include the namespace in the key. Use reflector
to find the correct name from the compiled exe...

Public Shared Function resourceToByteArray(ByVal iAssembly As [Assembly],
ByVal iKey As String) As Byte()
Dim pStmInput As Stream = iAssembly.GetManifestResourceStream(iKey)
If (pStmInput Is Nothing) Then
Throw New Exception("Resource '" & iKey & "' was not found in
assembly '" & iAssembly.ToString & "'.")
Else
Dim pBytBuffer(CInt(pStmInput.Length - 1)) As Byte
Call pStmInput.Read(pBytBuffer, 0, CInt(pStmInput.Length))
Call pStmInput.Close()
Return (pBytBuffer)
End If
End Function

You can then use Text.Encoding.<Encoder>.GetString() to obtain a string
from whatever format the initial text file was in...

Nick.

"Wendy Elizabeth" <We************@discussions.microsoft.com> wrote in
message news:2D**********************************@microsof t.com...
Herfried K. Wagner:

Thank you for answering my question. However, I should have mentioned
that
I am using Visual studio.net 1.1 (2003 version). Can you tell me how I
would
accomplish this task using Visual studio.net 1.1 instead?

Thanks!

"Herfried K. Wagner [MVP]" wrote:
"Wendy Elizabeth" <We************@discussions.microsoft.com> schrieb:
>I am writing a vb.net program that needs to create a table in the same
>format
> each time it creates a new table. This is a "ulility" program that I am
> going
> to be using it for.
> Right now I have keyed this large table into sql server 2000 and the
> vb.net program I wrote loads all the columns appropriately. I have run
> sql
> server 2000 with the "generate script" for me have have saved the sql
> server
> 2000 code that will create a table.
>
> The start of the script looks like
> "CREATE TABLE [dbo].[test_table] ([field1] [varchar] (40) COLLATE
> SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [field] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
>
> The end of the table looks like:
> [WC_USE.22] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ,[WC_PASSWORD.20] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS
> NULL
> , {
> [MPLANNER] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
>
> I would like to incorporate this code into the VB.net program. To to
> this
> I
> need to put " (quotes) at the start of every line and I need to put "
> &
> _
> at the end of every line.


If you are using VB 2005, choose "My Project" in the solution explorer,
click "Resources", add a new string resource, name it
'CommandStringStart',
and paste the start string into the resource. Then do the same for the
end
string. Inside the source code you can refer to the strings as shown
below:

\\\
Dim CommandString As String = _
My.Resources.CommandStringStart & _
... & _
My.Resources.CommandStringEnd
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2039
by: TheDustbustr | last post by:
I just downloaded the uthread module for stackless python. Whenever I import it it says it can't find the continuation module. Anyone know where I can get it? Thanks, Dustin
0
1084
by: bgoli | last post by:
Hi Are there any existing parameter continuation routines either coded in Python or with a Python interface? TIA
2
2164
by: Jasper Recto | last post by:
I have a statement that I can't seem to use Line Continuations on it: Progress = "V:\PROGRESS\bin\prowin32.exe V:\VANTAGE\db\vantage.db_ -ininame V:\VANTAGE\vantage.ini -pf...
2
66908
by: Don Leckie | last post by:
Hi, I've searched all my Java books ans newsgroup archives and found nothing. Once I thought that I saw a character at the end of a line allowed a String literal to span multiple lines. I...
5
1558
by: Sandra-24 | last post by:
I'm not sure how complex this is, I've been brainstorming a little, and I've come up with: If the previous line ended with a comma or a \ (before an optional comment) That's easy to cover...
2
1793
by: rj_noone962 | last post by:
Hello, I am trying to build a SQL statement dynamically for execution within a procedure, using PREPARE ... OPEN. SET v_sql = ' SELECT a,b,c,d,e, .....x,y,z FROM table1, table2 WHERE a =...
6
2391
by: Haakon Riiser | last post by:
After a long debugging session while scripting my webmail, I believe I have traced the problem to the way httplib sends POST requests. I have compared tcpdump listings from Python 2.4.3 and...
3
3409
by: psbasha | last post by:
Hi , I am following backslash ('\') as continuation of line as per the coding guidelines.Is there any other character to be used as continuation of line? Thanks in advance PSB
6
1969
by: Russ P. | last post by:
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for...
3
4435
by: MLH | last post by:
I don't understand why (a) works and compiles but (b) does not... (a) Set qdfTemp = .CreateQueryDef("", _ "SELECT * FROM Employees") (b) Set qdfTemp = .CreateQueryDef("", _ "SELECT...
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.