|
|
Based off the information provided I can offer you two entirely foolproof solutions.
Split your program into two programs, therefore programming yourself out of a corner.
or
Rewrite your program into two programs, therefore programming yourself out of a corner.
See how helpful answers can be when you provide no information at all? Just imagine the possabilities when you don't waste my time provide actual details.
|
|
|
|
|
I suggest you go and watch some of the video's over at MSDN
Look at the Forms Over Data series, Understanding Data and the one's relating to N-Tier subjects.
From these you can then start to look at exactly what you are trying to achieve, when you mean split do you mean client side N-Tier layers, or are you looking to consume web services etc.
http://msdn.microsoft.com/en-gb/vbasic/bb466226.aspx[^]
|
|
|
|
|
I do not even know where to start with this request, but I need to be able to write some text to about 40 years worth of a MS Outlook Calendar. Is it possible to programmatically write to a MS Calendar in Outlook in a loop?
<br />
for each item in Microsoft.Outlook.Calendar(myName@email.com)<br />
<br />
Outlook.Date.Text = "Text to Write"<br />
<br />
Next<br />
Are there some articles about writing code for Outlook Calendars that you could point me to? Any assistance would be appreciated.
|
|
|
|
|
|
I have just purchased Visual Studio 2008 professional edition. I am trying
to learn how to populate nodes on the Treeview from a database. I have
found several websites that have the code I need but they all rely on
my having the "microsoft.web.ui.webcontrols" namespace.
But that's just it! When I try to include this namespace, it says it does
not exist. What's that all about? Why haven't i got it, and where can I get it?
Man, this is annoying!
|
|
|
|
|
That will be for a web based application.
You need to look at windows forms controls examples. [unless of course you are trying to create a web app]
|
|
|
|
|
Thanks Dave, in fact i am trying to create all this in a web site.
Can you still help?
|
|
|
|
|
|
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
|
|
|
|