Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Thursday, March 22, 2012

on Check Constraint expressions

I am creating a check constraint on a field (GRID_NBR) for values between 1 & 99. I am a little confused on creating the expression for it (Books online is vague).

Can I use the following expression: GRID_NBR BETWEEN 1 AND 99

Or do I have to use: GRID_NBR > 0 AND GRID_NBR < 100

Thanks!I am creating a check constraint on a field (GRID_NBR) for values between 1 & 99. I am a little confused on creating the expression for it (Books online is vague).

Can I use the following expression: GRID_NBR BETWEEN 1 AND 99

Or do I have to use: GRID_NBR > 0 AND GRID_NBR < 100

Thanks!

I found my own answer (in Books Online)...here's the example it gave on the Constraint page...

CREATE TABLE cust_sample
(
cust_id int PRIMARY KEY,
cust_name char(50),
cust_address char(50),
cust_credit_limit money,
CONSTRAINT chk_id CHECK (cust_id BETWEEN 0 and 10000 )
)

Tuesday, March 6, 2012

.NET config file for Custom event Provider?

Hello all,

I'm creating a custom event provider for SSNS 2005 using .NET. My custom provider needs to get configuration info from a file (e.g. app.config).

Is there any (acceptable?) way of making my config file data available to my provider if I'd like my provider to be hosted by SSNS? Perhaps I could hack it by making or adding to an app.config for some part of SSNS (the instance service executable perhaps?) but that doesn't sound appetizing.

The only thing I can think of is to force my event provider to run as a standalone EXE (which means a standard app.config should work).

Help?

OK, I found that it is quite simple to use a specific config file for my DLL (especially using EntLib).

However, issues with codebases and so forth for dependent assemblies has turned me to switch. I'm now using a standalone event provider because it avoids all these issues around config files, dependencies, and so forth (everyhing is simply in one standard bin folder).

.NET config file for Custom event Provider?

Hello all,

I'm creating a custom event provider for SSNS 2005 using .NET. My custom provider needs to get configuration info from a file (e.g. app.config).

Is there any (acceptable?) way of making my config file data available to my provider if I'd like my provider to be hosted by SSNS? Perhaps I could hack it by making or adding to an app.config for some part of SSNS (the instance service executable perhaps?) but that doesn't sound appetizing.

The only thing I can think of is to force my event provider to run as a standalone EXE (which means a standard app.config should work).

Help?

OK, I found that it is quite simple to use a specific config file for my DLL (especially using EntLib).

However, issues with codebases and so forth for dependent assemblies has turned me to switch. I'm now using a standalone event provider because it avoids all these issues around config files, dependencies, and so forth (everyhing is simply in one standard bin folder).

.net cf class library commenting problem.

Hi All,

Now I am creating .Net CF2.0 class library project, and I have some public method which take parameters. And I commented those method using following tag.

/// <summary>

///

/// </summary>

/// <returns></returns>

But when I add to other project where I wanted use that dll , when I create instance andcall the method it’s not giving me the description which I gave. But when I refer in the same class library project itself it’s giving outside that it’s not giving the details.

Could you please anyone to solve this problem ?

Thanks ,

Jayakumar a

Hey when you compile the DLL with the above source, compile using /doc switch of CSC.EXE which then generates an XML file.

Place this XML file in the same direction as DLL which you have referenced so that you can see intellisense. Hope this helps!

By the way, this is not the right forum for your question. Please post this type of questions to VS IDE Forums so that you get better answers!

Thanks,

Laxmi

Friday, February 24, 2012

.dbf file import (duplicate Field Names)

I am importing a file creating by an application which exports the file into .dbf format. Very unfortunately, this .dbf file can have fields with IDENTICAL column_names. Utilizing ActiveX, I create an ado connection to the .dbf file using a visual foxpro drver. However, and not unexpectantly, I can not do the 'select *' from the file if there are duplicate names.

Can anyone make recommendations here that might help?

Oh, this is SQL200 in case that impacts what you might advise!!!!

Anyone out there from MSFT want to make some suggestions?|||

Hi Ellen,

I find it surprising that the DBF file can have duplicate field names. What application created it? Is it a FoxPro DBF or a DbaseIV or Paradox DBF?

I assume you are able to read the table structure with something other than SQL Server, is that correct?

Are you using ODBC or OLE DB? The latest FoxPro and Visual FoxPro OLE DB data provider is downloadable from msdn.microsoft.com/vfoxpro/downloads/updates .

Thursday, February 9, 2012

(SQL Mobile)Can SELECT, but cannot INSERT/UPDATE. Why not?

I'm just getting started with using SQL Server Mobile while creating a handheld app using Visual Studio 2005. So far, I have succeeded in RETRIEVING data from the mobile database, but I don't understand why my INSERT nor UPDATE statements will not work. (I'm assuming they don't work, because after I run my code via the debugger, I oddly get no error message, but when I "open" the table in the Server Explorer, I do not see my expected results. Do I need to do some kind of "commit" or something? Here's my code. Thanks for any help! - Sue

-

'Create SQL statement:
Dim strSQL As String
strSQL = "INSERT INTO MyTable (col1, col2) VALUES ('yucky', 'poo')"

'Create DB connection:
Dim connDB As New System.Data.SqlServerCe.SqlCeConnection
connDB.ConnectionString = ("Data Source =" _
+ (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase) + "\SueUWM.sdf;"))

'Create DB command:
Dim cmndDB As New System.Data.SqlServerCe.SqlCeCommand(strSQL, connDB)

'Open the connection:
connDB.Open()

'Execute the command:
Dim intRecordsAffected As Integer
Try
intRecordsAffected = cmndDB.ExecuteNonQuery()

If intRecordsAffected <> 1 Then
MessageBox.Show("Unable to insert into database.")
End If
Catch ex As Exception
MessageBox.Show(ex.ToString, "Insert Error")
End Try

'close the DB connection:

connDB.Close()

-

I am so dumb! I just learned that the insert & update modifications are made on the .sdf file on the emulator, and therefore will *not* be visible to me in Visual Studio's Server Explorer (on the desktop)! - Sue

(Select All) Checkbox As Default

All,

When creating a dynamic parameter list from a query, Reporting Services graciously provides a "(Select All)" checkbox. How can I select this checkbox by default so that when a user generates the report, all of the values are selected?

Thanks

The "select all" item is just a UI concept at this point. You could setup a default value for the report parameter that contains all values of the valid values list - but in that case all the checkboxes for individual items would be pre-selected, but the "select all" would still not be pre-selected.

-- Robert

|||Thanks for the reply. I actually tried your approach before posting my question. The problem that I am facing when using this approach is that the pre-selection is always static so this will not work when my checkbox list is populated from a query. Since the results of the query are dynamic, I can't setup a default list with any degree of accuracy.|||

Robert,

Is there any way to tell when the Select All option is selected?

R

|||

I don't know if this works

But if my dropdown source is Query, and with "Multi-Value items" checkbox checked

Under Default Values, If I choose "Query", pick the Dataset, put in the value field -> it will select all rows in the query by default

When I go to Preview, all items from the query ARE checked in the dropdown. Even the "ALL" option I created myself

(now the problem is, how do you uncheck them all with ease...)

I hope that's what you're looking for, I wish there's easy way to post pictures

|||

The closest you can get is to compare the number of rows in the dataset used for the valid values list (e.g. =CountRows("ParameterDataSetName")) with the number of selected parameter values (e.g. =Parameters!P1.Count)

-- Robert

(Select All) Checkbox As Default

All,

When creating a dynamic parameter list from a query, Reporting Services graciously provides a "(Select All)" checkbox. How can I select this checkbox by default so that when a user generates the report, all of the values are selected?

Thanks

The "select all" item is just a UI concept at this point. You could setup a default value for the report parameter that contains all values of the valid values list - but in that case all the checkboxes for individual items would be pre-selected, but the "select all" would still not be pre-selected.

-- Robert

|||Thanks for the reply. I actually tried your approach before posting my question. The problem that I am facing when using this approach is that the pre-selection is always static so this will not work when my checkbox list is populated from a query. Since the results of the query are dynamic, I can't setup a default list with any degree of accuracy.|||

Robert,

Is there any way to tell when the Select All option is selected?

R

|||

I don't know if this works

But if my dropdown source is Query, and with "Multi-Value items" checkbox checked

Under Default Values, If I choose "Query", pick the Dataset, put in the value field -> it will select all rows in the query by default

When I go to Preview, all items from the query ARE checked in the dropdown. Even the "ALL" option I created myself

(now the problem is, how do you uncheck them all with ease...)

I hope that's what you're looking for, I wish there's easy way to post pictures

|||

The closest you can get is to compare the number of rows in the dataset used for the valid values list (e.g. =CountRows("ParameterDataSetName")) with the number of selected parameter values (e.g. =Parameters!P1.Count)

-- Robert

(Select All) Checkbox As Default

All,

When creating a dynamic parameter list from a query, Reporting Services graciously provides a "(Select All)" checkbox. How can I select this checkbox by default so that when a user generates the report, all of the values are selected?

Thanks

The "select all" item is just a UI concept at this point. You could setup a default value for the report parameter that contains all values of the valid values list - but in that case all the checkboxes for individual items would be pre-selected, but the "select all" would still not be pre-selected.

-- Robert

|||Thanks for the reply. I actually tried your approach before posting my question. The problem that I am facing when using this approach is that the pre-selection is always static so this will not work when my checkbox list is populated from a query. Since the results of the query are dynamic, I can't setup a default list with any degree of accuracy.|||

Robert,

Is there any way to tell when the Select All option is selected?

R

|||

I don't know if this works

But if my dropdown source is Query, and with "Multi-Value items" checkbox checked

Under Default Values, If I choose "Query", pick the Dataset, put in the value field -> it will select all rows in the query by default

When I go to Preview, all items from the query ARE checked in the dropdown. Even the "ALL" option I created myself

(now the problem is, how do you uncheck them all with ease...)

I hope that's what you're looking for, I wish there's easy way to post pictures

|||

The closest you can get is to compare the number of rows in the dataset used for the valid values list (e.g. =CountRows("ParameterDataSetName")) with the number of selected parameter values (e.g. =Parameters!P1.Count)

-- Robert