|
These DataView's are useless since you're only putting the data from a single table into each one and you haven't changed what your viewing in each table. You're actually just returning the exact same thing each tables default view would return.
What does your INSERT SQL stuff look like? That's where the bulk of the work is going to be done.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I used dataviews and bound them to datagrid to check if the data was read correctly since I do not have the schema of the XML data. Actually below is my insert statement and is pointing to a stored procedure.
objDataset.ReadXml(strFile)
'create a dataview object for the books table in the dataset
Dim dvLayers As New DataView(objDataset.Tables("Layer"))
Dim dvDatasets As New DataView(objDataset.Tables("Dataset"))
Dim dvREnderer As New DataView(objDataset.Tables("SIMPLERENDERER"))
Dim dvLineRenderer As New DataView(objDataset.Tables "SIMPLELINESYMBOL"))
Dim dvPolyRenderer As New DataView(objDataset.Tables("SIMPLEPOLYGONSYMBOL"))
Dim dvMarkerRenderer As New DataView(objDataset.Tables("SIMPLEMARKERSYMBOL"))
Dim cmdInsertLyr As New SqlCommand("", ConDb.Connect)
cmdInsertLyr.CommandText = "dbo.[Insert_LyrView]"
cmdInsertLyr.CommandType = CommandType.StoredProcedure
cmdInsertLyr.Connection.Open()
cmdInsertLyr.Parameters.Add("@LyrID", "")
cmdInsertLyr.Parameters.Add("@LyrName", "")
cmdInsertLyr.Parameters.Add("@LyrType", "")
cmdInsertLyr.Parameters.Add("@Visible", "")
cmdInsertLyr.Parameters.Add("@ID", "")
cmdInsertLyr.Parameters.Add("@Map_id", "")
cmdInsertLyr.Parameters.Add("@dtName", "")
cmdInsertLyr.Parameters.Add("@dttype", "")
cmdInsertLyr.Parameters.Add("@workspace", "")
cmdInsertLyr.ExecuteNonQuery()
and following is the stored procedure am using.
CREATE PROCEDURE [Insert_LyrView]
(
@LyrID int,
@LyrName [nvarchar](250),
@LyrType [nvarchar](250),
@Visible [nvarchar](250),
@id int,
@map_id int,
@dtname [nvarchar](250),
@dttype [nvarchar](250),
@workspace [nvarchar](250)
)
AS INSERT INTO [LayerView]
(LayerID,
LyrName,
LyrType,
Visible,
id,
map_id,
dtname,
dttype,
workspace
)
VALUES
(@LyrID,
@LyrName,
@LyrType,
@Visible,
@id,
@map_id,
@dtname,
@dttype,
@workspace
)
GO
Am stuck in passing the values from the dataset to the parameters to the cmdinsertlyr!!!And I left the values of the parameters empty!!!
|
|
|
|
|
How many tables does this [LayerView] combine? IIRC, you can only make changes to one base table of a view at a time.
Pick a dataset table, say Layers. All you have to do is iterate through the records in the table, assign the values from each column in the table to the parameters in the SQLCommand and execute the command, one record at a time. If you have 1000 records in your Layers table, then you'll assign the values from each column to the parameters of your SQL command and execute it 1000 times.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i m facing problem when export data from access data file to sql server with the help of DTS.
can any body provide any solution for this.
its urgent
thanks in advance
|
|
|
|
|
You didn't ask any specific questions, so the best anyone can do if refer you to a couple of articles on the subject:
DTS Custom Task in VB.NET[^] on VBDotNetHeaven
Best Practices for Using DTS ...[^] on MSDN
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 11:08 Tuesday 10th January, 2006
|
|
|
|
|
hi
i m getting following error
"QueryInterface for interface DTS.CustomTask failed"
and
my code is
Dim oPackage As New DTS.Package2
Dim oConnection As DTS.Connection
Dim oStep As DTS.Step2
Dim oTask As DTS.Task
Dim oCustomTask As DTS.BulkInsertTask
Try
oConnection = oPackage.Connections.New("SQLOLEDB")
oStep = oPackage.Steps.New
'oTask = oPackage.Tasks.New("DTSBulkInsertTask")
oTask = oPackage.Tasks.New("DTSExecuteSQLTask")
'DTSExecuteSQLTask'
oCustomTask = oTask.CustomTask
With oConnection
oConnection.Catalog = "cdms"
oConnection.DataSource = "SBS-DEVELOPMENT\SQLCLASSIC"
oConnection.ID = 1
oConnection.UseTrustedConnection = True
oConnection.UserID = "cdms"
oConnection.Password = "cdms"
End With
oPackage.Connections.Add(oConnection)
oConnection = Nothing
With oStep
.Name = "GenericPkgStep"
.ExecuteInMainThread = True
End With
With oCustomTask
.Name = "GenericPkgTask"
.DataFile = "E:\PROJECT ASSIGNED\Projects\CDMS\CDMS_Phase_2\CDMS_Phase_2_Requirements\encounter05\encounter05.mdb"
.ConnectionID = 1
.DestinationTableName = "cdms..tblMemberEncounters"
.FieldTerminator = "|"
.RowTerminator = "\r\n"
End With
oStep.TaskName = oCustomTask.Name
With oPackage
.Steps.Add(oStep)
.Tasks.Add(oTask)
.FailOnError = True
End With
oPackage.Execute()
Catch ex As Exception
Finally
oConnection = Nothing
oCustomTask = Nothing
oTask = Nothing
oStep = Nothing
If Not (oPackage Is Nothing) Then
oPackage.UnInitialize()
End If
End Try
|
|
|
|
|
Copy, paste, and pray, huh?
It's obvious that's what you did because there's far more to getting a package to work that just this code. That's 108 page document in the second link has entire section dedicated to building a custom DTS package and getting it to work. There's far more to it than just a little code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I have an application where the front end is in ASP and the dll which supports it is written in C#.
I am using 'regasm' command to register it for com inter-operatibility.
C# dll methods are working fine for string type parameters, but not for LONG and INT type parameters. It throws an error saying:
__________________________________________________________________________
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'GetReportsData'
__________________________________________________________________________
I am passing the LONG parameter from ASP. Example:
_________________________
Method in C#
public string takeint(long param)
{
//code
}
________
Call from ASP
var1=object.takeint(Clng("100"))
_________________________
This operation throws above mentioned error.
What are the compatible datatypes for LONG and INT of ASP in C# as I can't change the ASP call, but I can change the C# code?
Thanks.
--------------------------------
From: saurav goel
|
|
|
|
|
A long in ASP corresponds to an int (Int32) in C#. (There is no data type in ASP that corresponds to a long (Int64) in C#.)
---
b { font-weight: normal; }
-- modified at 7:20 Tuesday 10th January, 2006
|
|
|
|
|
C# questions belong in the C# forum, not VB.NET.
Posting the same question in multiple forums (cross posting) is also considered very rude.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
* How to store data in a public variable(global) and make it available throughout the application?
Mayur
|
|
|
|
|
if u r talking about window application then u can use a module and in that module declare a public variable which can be used through out the application
if u r talking about web application then use session variables they can be used throughout user session..
abhinav
|
|
|
|
|
Hi Abhinav,
Thnx for your reply. Actually I want the user to input some data (Month & Year) which I want to use throuhout the application. How can this be done.
With Regards,
Mayur
|
|
|
|
|
Put it in a shared property in a class eg
Public class Globals
private shared myear as string
shared property Year() as string
get
return myear
end get
set(byval value as string)
myear = value
end set
end property
end class
Then you can call it from anywhere in your application by using
globals.Year = "2005"
or
dim newYear as string
newYear = globals.Year
Jon
|
|
|
|
|
Jon, Thnx a lot.
With Best Regards,
Mayur
|
|
|
|
|
Hello,
I have been searching around for a while and haven't been able to find anything to do this. I would like to create a form in VB.NET that performs a HTTP POST request to a web server. Is this possible? I don't want a web page as a text entry page with a submit button, I would like it all to be performed from a simple VB.NET application. Any examples, or pointers in the right direction would be much appreciated - Cheers Matt
|
|
|
|
|
You're looking for the HttpWebRequest[^], specifically, changing it's Method parameter to "POST".
You can find a bunch of examples by Googling for "HttpWebRequest method post[^]"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all
I want to have a column in datagridview which is showing the combobox with multiple columns
Can Datagridviewcomboboxediting control class can help in any way
Plz its very urgent to me
Can idea , Clue , Suggestion, Source, way is highly appreciated
Thanks for this help
Hema Chaudhry
|
|
|
|
|
Section 5.9[^] of George Shepherd's Windows Forms FAW shows you how to add a normal ComboBox to a DataGrid.
Now, the .NET Framework doesn't supply a multiple column ComboBox, so you'll have to implement your own control to do it. Once you have the contorl built, you can add it to the DataGrid, just lkike a normal ComboBox.
You can find a multi-column ComboBox here[^] on CodeProject.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for reply
The links which u suggested r not working with
vb.net 2003 datagrid
I will try in the vb.net 2005
DO u know how to add the custom controls in datagridview of vb.net 2005
Thanks in advance
Hema Chaudhry
|
|
|
|
|
Actually, that code was written in 2003. You can't just copy, paste, and pray it works. You have to fully understand what's going on in that code.
Custom controls are handled by the DataGrid no differently than the standard controls, provided the custom controls are written exposing the correct interfaces.
THe code on those links won't work with 2005 because the DataGrid was replaced with the DataGridView control, which doesn't work the same way the old DataGrid does.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
I want to know the HOST NAME of a machine.
For that I will input the IP of that machine and it will show me the HOST name.
also the vice versa.
i am able to retrive the localhost IP using WINSOCK control.
plz help me
Paritosh
|
|
|
|
|
What you're looking for can be found in the Dns class, GetHostByAddress[^] method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
how can i convert the below vbscript into .net ?
thanks
Computer = InputBox("Enter the computer name","Terminate Process",
"localhost")
PName = InputBox("Enter the name of the process","Terminate Process")
Set Processes = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
Computer & "\root\cimv2").ExecQuery("select * from Win32_Process where Name
= '" & PName & "'")
For each Process in Processes
Process.Terminate
Next
|
|
|
|
|
The System.Management namesapce has everything you'll need to do this. I wish it was a bit simpler to use though...
Import System.Management
.
.
.
' SELECT * FROM Win32_Process WHERE Name='processName'
Dim query As New SelectQuery("Win32_Process", String.Format("Name='{0}'", processName) )
' Initialize an object searcher with this query
Dim searcher As New ManagementObjectSearcher(query)
' Define arguments for our WMI method call on each object returned, in our
' case, Nothing (null)
Dim methodArgs() As Object = {Nothing}
' Get the resulting collection or Process objects and loop through it
For Each ManagementObject foundProcess In searcher.Get()
Debug.WriteLine( String.Format("Killing process: {0}", foundProcess.Properties("Name") ) )
foundProcess.InvokeMethod("Terminate", Nothing)
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|