|
I am using Visual Studio 2003. I am wondering if I can have a global dataset.
The ideal thing I would want is when someone opens this web application I would want the app then to connect to the database and haul down a table to be stored in a dataset. Then I want to be able to use this dataset anywhere in my application.
Reason I am asking is that I will need to refer to this table numerous times over the run of the application and rather than having numerous connections or leaving open a connection I would rather store the dataset in a global variable for quick use.
|
|
|
|
|
If you are working with a web app I'm not sure a global dataset is the solution. You are going to have all kinds of problems when multiple users access it at the same time. A global variable in a web project is a single variable for everyone who uses it...not a variable for a single user on a single session. I would suggest that instead you make a global method to run queries/procedures to your database. In these global methods you can include the code to open and close a single connection so you will always be sure to only have one open and you will not leave it open when you are not using it.
I hope this helps.
|
|
|
|
|
i haven't tried it personally but I think you can use cache for this. do some research on it...
|
|
|
|
|
|
Hi to everyone,
I'm writing, maintaining and deploying some applications: every aplication is made up by an executable (winexe) and some dlls (class library). To distribute them, I generate a Setup program for each application using the standard Setup project included in Visual Studio 2003.
Everything used to work fine but, a couple of weeks ago, the generated Setup for one application "lost" one library: it was simply missing from the .msi file and I had to include manually into the project to force the installation. Last week another Setup "forgot" three assemblies.
I also wrote a little vb.net program to scan - through reflection - all the referenced assemblies in the winexe and copy these assemblies in another folder and actually I found out that the same assemblies were missing from the new destination folder (but still there in the bin directory)
Given that:
- each application has all the references to the assemblies, with LocalCopy=True (indeed, I can find them in the bin directory)
- each Setup project is in a different solution than the application
- each Setup project is SourceSafe'd
- each assembly (winexe and library) is obfuscated and strong-named
- I checked version and date properties for the missing assemblies and they were coherent with the application (same version and date/time)
am I doing something wrong (or missing something important) or did?
Thanks in advance to anyone will help.
Marco Turrini
|
|
|
|
|
hello
i have a big headache to this problem that i wasnt able to find an answer, guys i really wanted your help if you can fix this, i'm using vb.net 2005 and using crystal report 9, my only problem is that the sub report, i dont know how to call that sub report that is part of the main report, it's always asking for login and password when the report is called, here's my codes and kindly and something that could fix my problem, here it is,
Dim appRdr As New System.Configuration.AppSettingsReader
Dim objreport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
objreport.Load(Application.StartupPath & "\reports\Employee_Profile_with_subreport.rpt")
objreport.SetDatabaseLogon(appRdr.GetValue("Username", GetType(String)), appRdr.GetValue("Password", GetType(String)), appRdr.GetValue("Server", GetType(String)), appRdr.GetValue("Database", GetType(String)))
objreport.SetDatabaseLogon("", "")
objreport.Refresh()
objreport.SetParameterValue("@IDNUMBER", Me.cboemployeeprofileid.Text)
Applicant_Reports.appreports.ReportSource = objreport
Applicant_Reports.Show()
employee_profile_with_subreport is the main report, and it has 3 sub report inside of that main, now when i deploy to another comp. and load that report, he will ask log-in and password and my sql is only windows authentication...help me gys..
|
|
|
|
|
How to get IP Address and Network card MAC Address using VB.NET ?
Thiwa
|
|
|
|
|
I get all code from http://www.codeproject.com[^]
to get MAC Address Imports System.Management
Dim strMACAddress As String = ""
'
' Create the query, in SQL syntax, to retrieve the properties from
' the active Network Adapter.
'
Dim strQuery As String = "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"
'
' Create a ManagementObjectSearcher object passing in the query to run.
'
Dim query As ManagementObjectSearcher = New ManagementObjectSearcher(strQuery)
'
' Create a ManagementObjectCollection assigning it the results of the query.
'
Dim queryCollection As ManagementObjectCollection = query.Get()
'
' Loop through the results extracting the MAC Address.
'
Dim mo As ManagementObject
For Each mo In queryCollection
strMACAddress = mo("MacAddress").ToString().Replace(":", "")
Exit For
Next
Dim a1 = strMACAddress
to get IP Address or MachineName Imports System.Net
Dim ipEntry As IPHostEntry = Dns.GetHostByName(Environment.MachineName)
Dim IpAddr As IPAddress() = ipEntry.AddressList
Ahmed El-Badry
|
|
|
|
|
Thank you very much.....;)
Thiwa
|
|
|
|
|
MAC address is alright but not working for IP address.....
Thiwa
|
|
|
|
|
to get ip address this wored
Imports System.net
Dim ipEntry As IPHostEntry = Dns.GetHostByName(Environment.MachineName)
Dim IpAddr As IPAddress() = ipEntry.AddressList
MsgBox(IpAddr(0).ToString())
to get hostname
Dim hostname As String
msgbox(Environment.MachineName)
Ahmed El-Badry
|
|
|
|
|
System.IO.Directory.GetDirectories
takes a search pattern as a parameter.
System.IO.Directory.Delete
takes a path to delete. You don't need the DirectoryInfo class.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello guys
help with following
having a folder ,containing many subfolders with the following names
folder 1 :2007-1-30
Folder 2 :2007-2-1
folder .....
how can write a function to let the user : specifies which subfolders to delete
i mean :if the user wants to delete everything with the name before:2007-2-20
algorithm: after choosing a date from the calendar ,delete all the subfolders where their name are inferior from the chosen date
what about the following code.what should i add to it
Dim mydate As String, mymonth As String, myyear As String<br />
mydate = Me.DateTimePicker1.Value.Day.ToString<br />
mymonth = Me.DateTimePicker1.Value.Month.ToString()<br />
myyear = Me.DateTimePicker1.Value.Year.ToString<br />
Dim dir_info As New DirectoryInfo(Path)<br />
dir_info.Delete(True )
Regards,
Regards
Ramy
Regards
Ramy
|
|
|
|
|
If you double post, you can delete one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Look at what has happened...
|
|
|
|
|
|
Give this a try
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim folderDate As Date 'Holds the date the folder name represents
'Loop through each folder under a given directory
For Each dir As String In IO.Directory.GetDirectories("c:\test")
'Try to parse folder name to valid date
Date.TryParse(IO.Path.GetFileName(dir), folderDate)
'If folderDate is less then Date selected, then remove it
If folderDate <> Nothing AndAlso Date.Compare(folderDate, DateTimePicker1.Value.Date) < 0 Then
IO.Directory.Delete(dir, True)
End If
Next
End Sub
|
|
|
|
|
thx man...
your My hero
Regards
Ramy
|
|
|
|
|
Hi everybody,
I'm looking for the way to control my WiFi connection on my PocketPC (Windows Mobile 5), but I can't find it anywhere.
I would like to, by example, choose the network I connect to by SSID, be able to know the WiFI stength signal, ...
Is there any existing object on the ConpactFramework giving me this ability ?
Thanks for your help,
Regards,
Ch'Portos.
|
|
|
|
|
!UP!
Regards,
Ch'Portos.
_________________________
while(1) {
fork();
}
|
|
|
|
|
I have a list box with a lsit of items which on forward button click the select items move to next list box,now on backward button click the select items from this listbox should back to the first at the same position?
thanks
|
|
|
|
|
try thi one...You have two list box. Please consiger the following statements are in the 'FORWARD' button. You can also accomplish the 'back' button by reversing it.
listBox2.Items.Add(listBox1.SelectedItem);
listBox1.Items.Remove(listBox1.SelectedItem);
//Hopes this help
|
|
|
|
|
Hi Friend
U can do this
Private Sub SendinRightListbox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendinRightListbox.Click
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
End Sub
Private Sub SendinLeftListbox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendinLeftListbox.Click
ListBox1.Items.Add(ListBox2.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
End Sub
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|
|
Hi,
Thanks ,but the solution given by you doesnt work in my case as the attched listbox image with make the question more clear,
Here the contents cc and receipient go from left to right listbox but physically they can be seen in the left list box which is the master listbox.Once this 2 values go to the right listbox if i want to bring them back to the first listbox both together,what should be done?I dont want ot create mutiple copies of the same values in the left listbox using ListBox1.Items.Add(ListBox2.SelectedItem)
so give me please a solution which will work in this case if possible.
thanks
|
|
|
|
|
When You send any item to right list box then remove it from left listbox
and move it right to left then remove it from right listbox
with this code
listbox2.items.remove(listbox2.selecteditem)
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|