|
Thanks again Dave,
However, when I try and load the reference System.Web.Extensions, the popup dialog shows
it in the .NET list, I highlight it and click "OK" but nothing happens and "Extensions" is still not available from System.Web.
Any ideas?
|
|
|
|
|
How about starting from a fresh project?
1) Open VS
2) Create Project
3) VB Projects / Web Project
4) ASP.Net Web Application; Also check on this dialog what your version of the .Net Framework, you are targeting.
What Reference do you have as default?
With My setup I get for a .Net 3.5 Target;
System
System.Configuration
System.Core
System.Data
System.Data.DataSetExtensions
System.Drawing
System.EnterpriseServices
System.Web
System.Web.Extensions
System.Web.Mobile
System.Web.Services
System.Xml
System.Xml.Linq
|
|
|
|
|
Thanks Dave,
I followed your instructions but I have no idea how to check
what references I get as default like in your list. I tried googling
"how can I check..." but got nothing" - could you just clarify
what I need to do here
thanks for your patience
Paul
|
|
|
|
|
There are 2 ways to do this;
1) From the Solution Explorer pane, click the "Show All Files" button at the top, then look under the References Node of the treeview
2) From the Solution Explorer pane, double-click "My Project" and then the References Tab, and look at the top list
|
|
|
|
|
Got that a few minutes after your last response - thanks.
I have all the ones on your list plus some others.
I have managed to get the references to validate nearly all my code except
some members see below (sorry for the length of the snippet)
[The actual problems bits are "parentnode.Nodes" where the error message says
"'Nodes' is not a member of 'System.Web.UI.Webcontrols.Treenode" also the same for
"Childnode.Tag" where "'Tag' is not a member of 'System.Web.UI.Webcontrols.Treenode"
Maybe these members are deprecated and I can replace with something else?
Anyway, let me know what you think]:
Dim DSNWind As DataSet
Dim CNnwind As New OdbcConnection("Dsn=MyLocalSQLDSN2;uid=root;pwd=jivers21")
Dim DACustomers As New OdbcDataAdapter("SELECT CustomerID, CompanyName, ContactName, Country FROM customers WHERE country = 'Germany'", CNnwind)
Dim DAOrders As New OdbcDataAdapter("SELECT CustomerID, OrderID, OrderDate, ShippedDate, ShipVia, Freight FROM orders where customerid in (select customerid from customers where country = 'Germany')", CNnwind)
Dim DAOrderDetails As New OdbcDataAdapter("Select * from [Order Details] where OrderID in (SELECT OrderID FROM orders where customerid in (select customerid from customers where country = 'Germany'))", CNnwind)
DSNWind = New DataSet()
CNnwind.Open()
DACustomers.Fill(DSNWind, "dtCustomers")
DAOrders.Fill(DSNWind, "dtOrders")
DAOrderDetails.Fill(DSNWind, "dtOrderDetails")
'Close the connection to the data store; free up the resources
CNnwind.Close()
'Create a data relation object to facilitate the relationship between the Customers and Orders data tables.
DSNWind.Relations.Add("CustToOrd", DSNWind.Tables("dtCustomers").Columns("CustomerID"), DSNWind.Tables("dtOrders").Columns("CustomerID"))
DSNWind.Relations.Add("OrdToDet", DSNWind.Tables("dtOrders").Columns("OrderID"), DSNWind.Tables("dtOrderdetails").Columns("OrderID"))
'''''''''''''''''''''''
TreeView1.Nodes.Clear()
Dim i, n As Integer
Dim parentrow As DataRow
Dim ParentTable As DataTable
ParentTable = DSNWind.Tables("dtCustomers")
For Each parentrow In ParentTable.Rows
Dim parentnode As TreeNode
parentnode = New TreeNode(parentrow.Item(0))
TreeView1.Nodes.Add(parentnode)
''''populate child'''''
'''''''''''''''''''''''
Dim childrow As DataRow
Dim childnode As TreeNode
childnode = New TreeNode()
For Each childrow In parentrow.GetChildRows("CustToOrd")
childnode = parentnode.Nodes.Add(childrow(0) & " " & childrow(1) &" " childrow(2))
childnode.Tag = childrow("OrderID")
''''populate child2''''
''''''''''''''''''''''''''
Dim childrow2 As DataRow
Dim childnode2 As TreeNode
childnode2 = New TreeNode()
For Each childrow2 In childrow.GetChildRows("OrdToDet")
childnode2 = childnode.Nodes.Add(childrow2(0))
Next childrow2
& ''''''''''''''''''''''''
Next childrow
'''''''''''''''
Next parentrow
|
|
|
|
|
Can you edit your message and wrap the code snippet in a code block and set the leading pre tag to have a lang="vb.net" attribute. That would make it easier to read;
e.g.
Dim childrow2 As DataRow
Dim childnode2 As TreeNode
childnode2 = New TreeNode()
For Each childrow2 In childrow.GetChildRows("OrdToDet")
childnode2 = childnode.Nodes.Add(childrow2(0))
Next childrow2
&
|
|
|
|
|
I'll have a go - is this what you mean?:
Dim DSNWind As DataSet
Dim CNnwind As New OdbcConnection("Dsn=MyLocalSQLDSN2;uid=root;pwd=jivers21")
Dim DACustomers As New OdbcDataAdapter("SELECT CustomerID, CompanyName, ContactName, Country FROM customers WHERE country = 'Germany'", CNnwind)
Dim DAOrders As New OdbcDataAdapter("SELECT CustomerID, OrderID, OrderDate, ShippedDate, ShipVia, Freight FROM orders where customerid in (select customerid from customers where country = 'Germany')", CNnwind)
Dim DAOrderDetails As New OdbcDataAdapter("Select * from [Order Details] where OrderID in (SELECT OrderID FROM orders where customerid in (select customerid from customers where country = 'Germany'))", CNnwind)
DSNWind = New DataSet()
CNnwind.Open()
DACustomers.Fill(DSNWind, "dtCustomers")
DAOrders.Fill(DSNWind, "dtOrders")
DAOrderDetails.Fill(DSNWind, "dtOrderDetails")
CNnwind.Close()
DSNWind.Relations.Add("CustToOrd", DSNWind.Tables("dtCustomers").Columns("CustomerID"), DSNWind.Tables("dtOrders").Columns("CustomerID"))
DSNWind.Relations.Add("OrdToDet", DSNWind.Tables("dtOrders").Columns("OrderID"), DSNWind.Tables("dtOrderdetails").Columns("OrderID"))
TreeView1.Nodes.Clear()
Dim i, n As Integer
Dim parentrow As DataRow
Dim ParentTable As DataTable
ParentTable = DSNWind.Tables("dtCustomers")
For Each parentrow In ParentTable.Rows
Dim parentnode As TreeNode
parentnode = New TreeNode(parentrow.Item(0))
TreeView1.Nodes.Add(parentnode)
Dim childrow As DataRow
Dim childnode As TreeNode
childnode = New TreeNode()
For Each childrow In parentrow.GetChildRows("CustToOrd")
childnode = parentnode.Nodes.Add(childrow(0) & " " & childrow(1) &" " childrow(2))
childnode.Tag = childrow("OrderID")
Dim childrow2 As DataRow
Dim childnode2 As TreeNode
childnode2 = New TreeNode()
For Each childrow2 In childrow.GetChildRows("OrdToDet")
childnode2 = childnode.Nodes.Add(childrow2(0))
Next childrow2
&
Next childrow
Next parentrow
|
|
|
|
|
|
Good day all,
I currently have a VB Webservice that opens, edits and saves an MS Word 2003 document via impersonation (my code is below, for those searching for impersonation techniques).
Everything works fine, what I would like to know is if there is a better way of manipulating an MS Word 2003 document without using impersonation? Due to security reasons, I am hoping to find a better way of approaching this.
I would highly appreciate it if you could help me out on this (if it is even possible!)
Thanks a lot
Rossouw de Bruin
Code:
' Values used by the LogonUser function's logonType parameter
Public Enum LogonType
LOGON32_LOGON_INTERACTIVE = 2
LOGON32_LOGON_NETWORK = 3
LOGON32_LOGON_BATCH = 4
LOGON32_LOGON_SERVICE = 5
LOGON32_LOGON_UNLOCK = 7
LOGON32_LOGON_NETWORK_CLEARTEXT = 8
LOGON32_LOGON_NEW_CREDENTIALS = 9
End Enum
' Values used by the LogonUser function's logonProvider parameter
Public Enum LogonProvider
LOGON32_PROVIDER_DEFAULT = 0
LOGON32_PROVIDER_WINNT35 = 1
LOGON32_PROVIDER_WINNT40 = 2
LOGON32_PROVIDER_WINNT50 = 3
End Enum
Declare Function LogonUser Lib "advapi32.dll" Alias "LogonUserA" ( _
ByVal username As String, _
ByVal domain As String, _
ByVal password As String, _
ByVal logonType As LogonType, _
ByVal logonProvider As LogonProvider, _
ByRef token As IntPtr _
) As Integer
Public Sub LetterTemplate()
Dim username As String = "username"
Dim domain As String = "domain"
Dim password As String = "password"
' A handle to the user who will be impersonated
Dim token As IntPtr
' Log the user into Windows.
Dim bLogonSuccessful As Boolean = Convert.ToBoolean( _
LogonUser( _
username, domain, password, _
LogonType.LOGON32_LOGON_NETWORK, _
LogonProvider.LOGON32_PROVIDER_DEFAULT, token))
If Not bLogonSuccessful Then
"Return something"
End If
' Create a WindowsIdentity object that represents the logged-in user.
Dim ident As New System.Security.Principal.WindowsIdentity(token)
' Impersonate the user.
Dim ctx As System.Security.Principal.WindowsImpersonationContext = ident.Impersonate()
'...... some other code
'Release the impersonation
ctx.Undo()
End Sub
|
|
|
|
|
You have me confused.
Why doesn't this work if you don't use impersonation?
Hang on, I probably know...
Your Web Service is running as IIS_USER or something. Now IIS_USER has never used Office interactively, so the whole Office suite is not really setup in his profile. Try logging on to the server once as the IIS_USER (or run your web server under another id), and Use Office once. This will setup zillions of registry keys in his profile, and integration should work afterwards.
|
|
|
|
|
Oh, and don't forget to restart the service after doing this, otherwise the profile will not be reloaded...
|
|
|
|
|
I made tables, codings and all using visual basic.
Is it possible to put all this information from the vb that i've done into Adobe Dreamweaver CS3 to make a website?
I want to make a webpage and i want to put the tables and all inside the webpage. is that possible? and how am i suppose to do it?
thank you.
|
|
|
|
|
If you're using VB6, you're out of luck.
If you're using VB.Net, and you have been using WinForms, you should be able to replace most of your form code by corresponding ASP.Net Controls.
Anyway, you'll have to create a new project (an ASP.Net project). Test your project using the Visual Studio embedded server.
You should then be able edit your webpages directly in DreamWeaver.
|
|
|
|
|
Hi Friends,
I am developing an application with VB 6.0 and Crystal Report 7,I need the code to use distinct keyword in crystal report selection formula.
for example: suppose i have a Table name "community". Its fields are S.No, Name, DOB,Community.
Then a person can be member of more than one community (Which shown below)
S.No|Name | DOB | Community
-------------------------------------------------------
0001|Anand Kumar |18/08/1985| Delhi IT Proo
0002|Amit Kumar |14/06/1984| Delhi IT Proo
0003|Anand Kumar |12/01/1981| Delhi Computers
0004|Rishu Mehra |17/08/1986| Delhi IT Proo
0005|Shivendra |11/05/1982| Delhi IT Proo
0006|Mahendra Kumar |09/02/1988| Delhi IT Proo
0007|Anand Kumar |31/04/1983| Delhi MCA
0008|Rishu Mehra |13/09/1984| Delhi Computers
Now i want to print the distinct names from Community table with serial no only (Other fields not required), Please tell me any selection formula on Name field, So that when crystal report open it'll display only DISTINCT names ignoring other details, only distinct!
That means Result would be...
S.No|Name
0001|Anand Kumar
0002|Amit Kumar
0004|Rishu Mehra
0005|Shivendra
0006|Mahendra Kumar
Can some body help me with this? Pz Plz pLz plZ plz
With regards
Anand Srivastava
anandbpsri@yahoo.co.in
anandbpsri@gmail.com
anandbpsri@hotmail.com
Anand Srivastava
|
|
|
|
|
i am using Vb 6.0 with Crystal Report 7 and wants to display distinct rows with crystal repot
please help me the selection formula.
Anand Srivastava
|
|
|
|
|
Hi!, You can protect your .net binaries with CodeDefender. hosted in codeplex. obviously for free
|
|
|
|
|
Self recommendation?
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Yes, i just obfuscated my DLLs
|
|
|
|
|
Perhaps you should pay for an ad like others do who advertise here...
|
|
|
|
|
Who would want it? It's in beta and no source code available (he mentions on his site that VS 2010 is needed to open the source)...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Good, but why not pay to advertise like everyone else.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I only have Visual Basic 2008 Express editions (web and windows forms).
Can I develop Silverlight applications in the Express environment? I want to start playing with it.
Also - has anyone heard whether there will be any 2010 VB Express versions released?
Thanks!
|
|
|
|
|
VB 2010 Express[^]
And yes, Silverlight does work with the express editions.
Hope that helps, vote up if it does
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
I am fixing to begin a project that has no existing code base. The application will track client demographic and billing information.
I would like your opinions on which technologies I should use. This will be written in VB.NET .NET 4.0.
Database mySQL, SQL Server etc which version(s).
Technologies Windows Forms, WPF, Silverlight, ASP/AJAX.
Would this be something that I should being using sharepoint for?
Any explanation of sharepoint would be nice/ I understand that it replaces somethings that we used to have to do manually.
There are no remote clients and probably won't be.
Humble Programmer
|
|
|
|
|
Surely someone has an opinion on this....
Humble Programmer
|
|
|
|