Yes, I can define it that way, but that only moves the potential problem, doesn't fix it.
Glenn
Yes, I can define it that way, but that only moves the potential problem, doesn't fix it.
Glenn
Hi, I'm not sure this is the best way to do this. I have an agent running as a service on thousands of servers. Each server can delete and add several hundred records into one table everyday. I have set the KEY as an integer using IDENTITY(1,1). During the initial testing I have noticed that SQL Server does not reuse the KEY. This makes me wonder what happens when I've added and deleted 4 Billion records (The max size of an Integer). Does it automatically wrap and I don't need to worry about this? This is SQL Server, and I'm wondering if I should be doing a database REORGs like we do with DB2. I know it would of been nice to be able to use a KEY and not worry about this. From what I've read the serial number from each distributor is supposed to be unique however I've run into duplicates right from the start where the distributor is using zero's as the serial number. Thanks, Glenn
Glenn
Hi, I am in the middle of writing an ASP.Net program that will hand off a software key when the Web Server is called. I am receiving information from the caller in a "Query String" and saving it in a common class. After I have saved all the Query Strings, I am calling a Web Service to generate the key, using properties in the common class. If I successfully generate a key, I save the properties in the common class and the key to a SQL database on the server. My question is should I use a static class or should I instantiate a new instance of the class? I'm concerned about the properties getting overlaid by the next caller before the key is generate and the information about the buyer is written to the SQL database. At least hopefully thinking that I will be selling that much software ;) Thank you,
Glenn
Hi, I am new to Linq and I'm trying to access the MfgNumber after the query directly without a foreach loop. I don't need the foreach loop as the SQL query should be returning one result.
[Table(Name = "Mfg")]
public class Mfg
{
[Column(IsPrimaryKey = true)]
public string MfgName;
[Column]
public string MfgNumber;
}
...
var q2 =
from mfg in db.Mfg
where mfg.MfgName == Common.productPublisherName
select mfg;
foreach (var mfg in q2)
MfgNumber = mfg.MfgNumber;
How do I access the variables from the query without a foreach? Thank you,
Glenn
Hi, I am working on a project where I receive an MP3 file used in the broadcast industry. However sometimes the MP3 file has dead air so to speak at the beginning and end of the file. I would like to be able to trim this automatically so that I can calculate the appropriate length of the MP3 file, and not broadcast the dead air. Any idea how to trim the MP3 on both ends for silence? Thank you and much appreciated,
Glenn
Hi, I'm a bit puzzled here and feel silly asking this question. I know how to open a new URL, read the response back from the web, etc if I initiate the request. Where I'm stuck is how do I do this if I don't initiate the request. Here is what I'm trying to do. A distribution center is going to call my Web Server via a Web Service. I'm supposed to obtain the fields of information they are passing to me via a Web GET request. How is this done? Thank you,
Glenn
Hi, I'm running SQL Server and I have an application that is creating a new database. However I'm not sure what directory I should store the database. Any suggestions? Thank you,
Glenn
Hi, I'm writing an application where I need administrator authority to create the database. I do not want to run as an administrator the entire time, just to create the file. How do I switch into Administrator mode and switch back? I know the User will get a prompt when trying to do this as I have seen other applications requesting administrator authority. Thank you,
Glenn
Hi, I fetch my connection string like this:
connectionString = Properties.Settings.Default.KTReunionConnectionString;
Which works perfectly. However I want to give the user the ability to name the database and update the string. Any attempt using the method below gives a compiler message that it's read only. How do I get around this?
Properties.Settings.Default.KTReunionConnectionString = connectionString;
I've tried this, however it doesn't not update in the app.config file:
var mySettings = ConfigurationManager.ConnectionStrings[0];
var cf = typeof(ConfigurationElement).GetField("_bReadOnly", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
cf.SetValue(mySettings, false);
mySettings.ConnectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=" + databaseName + "Integrated Security=True";
Is it possible to update the connection string? Thank you,
Glenn
Hi, I'm trying to copy from lets say column "AC" to column "AA". The cell contains a formula which I have gotten and built an array out of the spreadsheet. Where I am stuck is how do you get the formula to update. IE: If the formula was =ROUND(AC25) when I copy it programatically to column AA, it still says =ROUND(AC25) instead of =ROUND(AA25). I know I can use the replace command and do a string replacement, however if the formula is: =ROUND(A5+AB5) and is in column C, when I try to replace the A to a C, it becomes =ROUND(C5+CB5) instead of =ROUND(C5+AB5). So my question is there a built in method into the Excel that I can call to perform the cell copy updating the formulas such as Excel does when you do it by hand? Thank you,
Glenn
Actually a better method is to use the COM Excel application Quit method. You can also set the DisplayAlerts property to true or false depending if you want to get prompted for unsaved files. Thank you for your input.
Glenn
Hi, I am opening a spreadsheet, then opening 10 others to extract information from them to update the 1st spreadsheet. I then want to kill them in the reverse order that they were opened. I know I can get an array of processes (See code below) but what order is the array? Do I walk the array in the reverse order to kill the last one first?
Process[] pProcess;
pProcess = System.Diagnostics.Process.GetProcessesByName("Excel");
Thank you,
Glenn
Hi, I am suspecting that my VS2010 is improperly building the .RDLC file to use with SQL Server 2008 R2, as I am getting an error that I can't explain or figure out. The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded. If I rename the file to an .RDL it works, however I have to manually add the Data Source, DataSet and the SQL Query. Looking at the .RDLC file it doesn't look right as it has no data connections. Anyone have an example from VS2008 that works and you can send me via email, or paste into this link? Something simple like printing one field from the Northwind database. Much appreciated... :)
Glenn Sr. Software Specialist
Hi, I've built a brand new application written in C# with VS2010 and I'm getting an error with my .rdlc file that states: The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded. e:\test\test1\test1\Report1.rdlc test1 This is a local report, not a server based report. I can create different reports against the data base using Report Builder with no issues. Note, I'm NOT trying to transport the files between Report Builder and VS2010. Am I forced into using Report Builder Server reports once I install SQL Server 2008 R2? I would like to get this work as a local report and I'm not sure what is wrong. Any help is greatly appreciated. Thank you,
Glenn
Hi, Let me start off by giving some background on the events that have lead up to this issue that I'm having. I started with VS2008 and SQLEXPRESS. A few months later, I installed VS2010 and converted my project. A week or so later, I decided that I wanted to install SQL Server 2008 R2, so I installed that as well, not uninstalling SQLEXPRESS. My application has been running great and the reports were working fine for the past several months. I then rebuilt my entire application. Now I can not get my application to compile and I've been spinning my wheels in the mud for a week. What I am seeing is the message in VS2010 that states: The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded. Not being a SQL Expert from an Admin side I have read a lot of forums which basically said that I needed to get the Report Server running and grant the roles accordingly. The Report Server now works and I can create reports using Report Server R3 no problem, however I'm still getting the error when trying to compile. In the ReportViewer Tasks in VS2010, where you can select the report, I'm using a local report, not a server report. IE: ApplicationName.Reportname.rdlc I am guessing the issue is the NameSpace is for a Server report and not a local report, and I should have some type of ConnectString? I really don't know what the problem is. Any help is greatly appreciated. *** UPDATE *** - I still have the issue with a brand new application built with VS2010 using the same table stored in SQL Server 2008 R2. Am I restricted to using Server Based reports after installing SQL Server 2008 R2? <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition"> <DataSources> <DataSource Name="KTReunionDataSet"> <ConnectionProperties> <DataProvider>System.Data.DataSet</DataProvider> <ConnectString>/* Local Connection */</ConnectString> </ConnectionProperties> rd:DataSourceID0a8b6f23-4772-446f-9b27-5f180b760bc4</rd:DataSourceID> </DataSource> </DataSources>
Glenn
modified on Thursday, September 16, 2010 11:13 PM
What I'm actually trying to do is setup fast pathing to an application. IE: If I hit the 1 on my numeric keypad it will go to my email, 2 will take me to Visual Studio, 3 will be my browser, etc.
Glenn
Hi, I'm writing an application so that I can hotkey between several different applications. I know how to register and unregister the hot keys, where I need help is obtaining the windows title to compare and give that application focus. What I believe needs to happen is I need to iterate through each window/form to determine if this is the correct one, then switch to it. Any help or if you know of a programming example it would be greatly appreciated. Thank you,
Glenn
Hi, I'm trying to read an Excel spreadsheet that contains a variable amount of data, names, address, etc. I will always have columns A-Z, but the number of rows will change. I'm trying to determine the last row in the spreadsheet that contains data. I've tried this code, but it returns a very large number:
public int GetNumberOfRows( )
{
if (excelWorksheet == null)
return (-1);
return (excelWorksheet.Rows.Count);
}
Any help is greatly appreciated.
Glenn
Hi, I'm trying to figure out how to accept a rejected character in a masked text box. I am using a "Masked Textbox" for the person's last name and to ensure all alpha characters, I'm using "L?????????????????", however if the person's last name has a quote in it, the masked text box is rejecting it but in code I want to accept it. I see I can where I can check the character in the Reject event, however I can not cancel the reject. Any suggestions how to do this, other than using a Keydown event and accepting only the characters I want? Thank you,
Glenn
What I mean from a non-grid view is a detail view, where the controls are individual controls on a form instead of a grid view. Thank you,
Glenn