Location of the Temp folder for 2000\XP\Vista\7
I always forget where this damn location is at so I decided to post this so I would remember and maybe help someone else out who forgets like I do.
Windows 7\Vista: C:\Users\Username\App Data\Local\Temp or go to Start and type %temp%
2000\XP: C:\Documents and Settings\Username\Local Settings\Temp or go to Start–>Run and type %temp%
KB
OLEDB and SQL Connection Strings
- OLE DB Provider for SQL Server
For Standard Security
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User;" & _
"Password=myPassword"
For a Trusted Connection
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"
To connect to a “Named Instance”
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName\myInstanceName;" & _
"Initial Catalog=myDatabaseName;" & _
"User;" & _
"Password=myPassword"
Note: In order to connect to a SQL Server 2000 “named instance”, you must have MDAC 2.6 (or greater) installed.
To Prompt user for username and password
oConn.Provider = "sqloledb"
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName"
To connect to SQL Server running on the same computer
oConn.Open "Provider=sqloledb;" & _
"Data Source=(local);" & _
"Initial Catalog=myDatabaseName;" & _
"User;" & _
"Password=myPassword"
To connect to SQL Server running on a remote computer (via an IP address)
oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User;" & _
"Password=myPassword"
Where:
- “Network Library=DBMSSOCN” tells OLE DB to use TCP/IP rather than
Named Pipes (Q238949)
- xxx.xxx.xxx.xxx is an IP address
- 1433 is the default port number for SQL Server. Q269882 and Q287932
- You can also add “Encrypt=yes” for encryption
For more information, see: Microsoft OLE DB Provider for SQL Server
To view Microsoft KB articles related to OLE DB Provider for SQL Server, click here
- OLE DB Provider for SQL Server via SQLXMLOLEDB
The SQLXMLOLEDB provider is an OLE DB provider that exposes the Microsoft SQLXML functionality through ADO. The SQLXMLOLEDB provider is not a rowset provider; it can only execute commands in the “write to an output stream” mode of ADO.
oConn.Open "Provider=SQLXMLOLEDB.3.0;" & _
"Data Provider=SQLOLEDB;" & _
"Data Source=mySqlServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User;" & _
"Password=myUserPassword"
Getting data from a dropdownlist and a textbox in a sql statement
I recently created a program for work that allowed us to search our SQL database. I had envisioned a simple C# program with a dropdownlist, textbox and a gridview that allowed the user to choose which table they wanted to search from and enter their search string in the textbox. While this sounded easy, for a beginner programmer it all was except the damn dropdownlist. I was having problems getting a dropdownlist populated with the tables in my SQL database. I asked on forums, i searched forums, i exhausted Google – so i thought and camecould not figure this out. Well first of all I was using the SqlConnection, SqlCommand, etc when i should have been using OleDbConnection, OleDbCommand, etc.. So to populate a dropdownlist with the list of tables from SQL the code was:
OleDbConnection con;
OleDbCommand cmd = new OleDbCommand();
string s = @”Provider=SQLOLEDB; Data Source=NAMED\INSTANCE; Initial Catalog=DatabaseName; Integrated Security=SSPI;”;
con = new OleDbConnection(s);
cmd.Connection = con;
try
{
con.Open();
DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, “TABLE” });
DropDownList1.DataSource = dt.DefaultView;
DropDownList1.DisplayMember = “TABLE_NAME”;
con.Close();
}
catch (OleDbException ex)
{
MessageBox.Show(ex.Message.ToString());
}
This populated the dropdownlist with all the tables from the Initial Catalog, aka database, using “GetOleDbSchemaGuid”. Now to search the database using the dropdownlist and a textbox i used the following SQL syntax:
OleDbCommand command = new OleDbCommand(“SELECT * FROM ” + DropDownList1.Text + ” WHERE ColumnName LIKE ‘” + txtFind.Text + “‘”, objOleDbConnection);
Now the whole button event is as follows:
private void txtFind_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
OleDbConnection objOleDbConnection = new OleDbConnection();
string Connection = @”Provider=SQLOLEDB; Data Source=NAMED\INSTANCE; Initial Catalog=Database; Integrated Security=SSPI;”;
try
{
objOleDbConnection.ConnectionString = Connection;
objOleDbConnection.Open();
if (txtFind.Text != “”)
{
OleDbCommand command = new OleDbCommand(“SELECT * FROM ” + DropDownList1.Text + ” WHERE ColumnName LIKE ‘” + txtFind.Text + “‘”, objOleDbConnection);
OleDbDataAdapter objOleDbDataAdapter = new OleDbDataAdapter(command);
OleDbCommandBuilder objOleDbCommandBuilder = new OleDbCommandBuilder(objOleDbDataAdapter);
DataTable objDataTable = new DataTable();
objOleDbDataAdapter.Fill(objDataTable);
BindingSource objBindingSource = new BindingSource();
objBindingSource.DataSource = objDataTable;
DataGridView.DataSource = objBindingSource;
command.Dispose();
objOleDbConnection.Close();
txtStatus.Text = “SQL command executed successfully and the database connection is now closed.” +
“You are ready to type another ID and search”;
lblRowsReturned.Text = DataGridView1.RowCount.ToString();
}
}
catch (OleDbException ex)
{
// Print error message in txtStatus textbox
txtStatus.Text = “SQL error:” + ex.Message;
}
finally
{
// Close data reader object and database connection
if (objOleDbConnection != null)
objOleDbConnection.Close();
if (objOleDbConnection.State == ConnectionState.Open)
objOleDbConnection.Close();
}
}
}
So as you can see it is pretty simple to get a dropdownlist and a textbox to search a sql database based off the values either selected or entered on the form. I hope this helps someone out since I could not find anywhere that specified how to accomplish this. Maybe I was looking int he wrong areas or searching the wrong terms but god i could not find an example or answer anywhere. My answers on forums went unanswered as well.
K
BlackBerry Wallpapers 480×360
I am providing some BlackBerry wallpapers that I have collected. These were retrieved from various places and are NOT a creation of my own. So who ever has created these the credit goes to you and not me. I just thought that since they were free to me I would make them free to you.
I hope to be adding other various images, buttons, icons, etc. for the BlackBerry as time goes on so check back.
K
DVD vs Online Download
I recently purchased the Visual Studio Professional 2008 with MSDN Premium subscription from http://msdn.microsoft.com and I was glad to see that I am still able to get a hard copy (CD/DVD format) of all, or a majority, of the software that came with the subscription. Who wants to sit there and download all the software that comes with that subscription? For those of you who have never dealt with a MSDN subscription there is approx 381 various products to download and that is NOT including the various versions within those products such as; x86, x64, ia64, Enterprise, Web, Developer, Standard, Professional, Ultimate, Premium, Starter, etc.. To add to it all you have to use a burning software (Roxio Creator 10 with a Plextor SATA drive is by far the fastest solutions i have used, not saying there isn’t a faster solution out there) to create the bootable/installation disc. What a PIA ya know!
The purchase of a new laptop is another example of not receiving the installation media with your newly purchased machine. Sometimes and yes not ALL the time, do you even get the resource CD which contains the drivers if you ever have to reinstall a piece of hardware. you have to go out to the manufactures website and search to hopefully find the correct driver for the correct version of that piece of hardware. The Operating System (OS) disc NEVER comes with the new device, however, HP does offer the ability to create a restore disc. The ability to create the restore disc is a one shot thing so don’t screw up the burning process or think you have the right discs to burn with and, like me one time, have 2 discs that work then the rest don’t. Makes no sense sometimes, just supply the damn discs!
There are times that when having the ability to download software online is nice. I will take the Games for Windows Live for an example, I recently purchased the Batman Arkham Asylum and it gave me the ability to download it from their site rather than wait for the disc to show up several days later. I know I could have gone to Best Buy or some other comparable store and purchased the hard copy but this was 10 pm and Best Buy isn’t exactly open then and I wanted to play the damn game, lol!
So I guess what I am trying to get at is give the customer the CHOICE to choose whether or not they want the discs when they have paid good money for something, rather than not supplying the discs or giving the option to obtain the discs in some tangible format. The ability to get the discs use to be a standard, no questions asked, you just received the discs in the package.
K
Utilizing msconfig to make Windows 7 boot faster-True or False?
While the other day I was reading something off the Win 7 News newsletter i receive and there was an article on how to go into the Msconfig and set your machine to use all your processor cores during boot. The argument was why does Microsoft ship the operating system to automatically use all available cores during boot and Microsoft’s reply was that “This wasn’t suppose to have an affect”, however, so many users have complained that it does make a difference when this little controversial fix is done. So on to the “controversial” fix:
Open Msconfig by clicking on Start and then type Msconfig. Now click on the Boot tab.
Click on the Advanced options… button and another window will open which is shown below
By default the Number of processors isn’t check and neither is the Maximum memory. Click the check mark for the Number of processor and then click the drop down and choose the number which coincides with the amount of processor cores you have, usually the highest number. Click on the Maximum memory checkbox and the total amount of memory in your machine will be entered automatically for you.
Now the question I have is that if the check box isn’t checked then doesn’t that mean it will use all available processors/cores? I would think so however, everyone including me, have seen a performance increase in the start up times. Let me know if you don’t see a performance increase after performing this little fix because there are so many variations in machines out there that some people may not see a performance increase. I can tell you that on my machine I run several instances of Visual Studio 2010 or 2008, Firefox with at least 6-10 tabs open at any given time, IE8 running and downloading certain things, streaming SIRIUS satellite radio, outlook open, well you get the point my machine is rather fast, so if i can tell a difference then I am almost positive you should see an increase on boot times. Hope this tutorial was helpful…
K
Installing a custom action MSI on Windows Server 2008
If you receive the “Installer encountered an error. The error code is 2869″ then you need to do the following to resolve this issue:
- Open console prompt by right-clicking and Run as Administrator.
- Navigate to the directory where your msi is located.
- Type the following: msiexec /i “appname.msi” and hit enter
This will raise the privileges of the installer and allow your custom application to install. I was running into this error when I was attempting to install a service-based application on my Windows Server 2008 Enterprise Edition x64 server. I already lowered the UAC (User Account Control) to the lowest setting and was still getting this error. However, the above command allowed me to install my application.
K
Visual Studio 2010 Theme Preview Issue
After the much awaited release of the RTM version of Visual Studio 2010 I am still disappointed that the menu item “Theme” doesn’t work. I had the RC version installed and had been creating apps left and right. One of the first things I noticed with the new version of VS (Visual Studio for short) is the option to change the IDE’s theme to an array of choices. The theme choices are Default, High Contrast, Autumn, Emerald, Silver and Custom Colors. The Default theme colors look different than the previous versions of VS.
So you can see how the IDE looks with the default theme set as active. Now when I change the theme to anything else other than the default theme the IDE changes to a yellow, blue, white and redish colors. The newly applied theme renders the IDE almost unreadable and annoying. I had thought at first when I was using the Beta and RC version that maybe since it was a “new” option it just had some bugs that needed to be worked out. Well I was wrong. Now that I have the Release To Manufacture, which I downloaded off my MSDN Subscription, I am still exhibiting the exact same problem. Here is an example of what my IDE looks like when I apply any other theme besides the default setting.
The newly applied theme almost looks like I had applied the High Contrast theme, but that is not the case. So I figured well maybe I can just go to the custom colors option and apply my own theme. I end up receiving this error when I click on custom colors..
I don’t exactly understand why this is happening. I will however resolve this issue but you would think since this is a new IDE and as many people who use VS as their number IDE, that I would not be the only person having this issue. I hope that someone will post a comment about how to resolve this or possibly point me to an assembly that needs to be registered or something. I have tried the usual things like reboot, uninstall and reinstall, different machine that NEVER had VS Beta or RC installed on it and I am still exhibiting this problem. I thought, when I seen the ability to change the theme, wow this is a good idea Microsoft! Low and behold I was let down once again by the software giant and yes I like Microsoft people but sometimes they never cease to amaze me with their idiosyncrasies. Thanks for reading and happy postings!!
K
Themes for BlackBerry
So as of today I started playing around with the Plazmic Theme Builder or BlackBerry Theme Studio, whichever you want to call it, and I am amazed at how easily it is to create themes for your BlackBerry. I am use to having to code a bunch of lines of code behind my controls to get them functional but with this tool you just simply pick and edit. I attempted my first theme and you can see the results, which still need some tweaking, over at the Mobile page. This page is where I will start to place all things I do that pertain to the mobile platform. I hope you all like and will leave comments and suggestions.
K
Other Pages
Recent Posts
Differences
Information Technology
My Other Sites
Other Blogs
Software
Visitor Information
IPv4 & IPv6 Statistics
Current List of Viruses by Viruslist.com
TekBase Solutions RSS Feed
- Free BlackBerry Apps available for download. February 19, 2011Click Here to download a compressed folder containing a bunch of blackberry apps. The compatible model varies. […]
- New TekBaseSolutions.com design to be released! February 19, 2011We, at TekBase Solutions, felt it was time to perform a little update on the website and it's content. So we decided to move from the design with the menu embedded into flash to a more search engine friendly, XHTML. We hope you will like the new design and content we will be adding. Just to leak some of the content we are adding, a downloads section, rs […]






