C# - SQL Explicit And Implicit Permissions?

Mar 14, 2012

If default 'sa' account has sys_admin permissions for the whole SQL instance and all its databases. On the database itself, if I don't have db_datareader permission enabled, I would assume it doesn't need it as it is implied but I was wondering in .net, is there way to check if db_datareader has explicitly been enabled and not just implied from the 'sa' being a sys_admin.

View 1 Replies


ADVERTISEMENT

Custom Implicit/Explicit Conversion In 2003?

Aug 16, 2005

would like to define some custom Implicit conversion function within my VB class. How can i do that. I have seen samples in C# but not in VB

View 8 Replies

Implicit Vs Explicit Declaration Without The "Dim" Statement Preceding

Mar 9, 2010

Is an implicit declaration basically an explicit declaration without the "Dim" statement preceding it?

View 12 Replies

64-bit Error With LayoutKind.Explicit?

Apr 7, 2010

I run understanding code in my bridge program to call the double dummy solver dds.dll.

<DllImport("dds.dll", CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function SolveBoard(ByVal deal As dealstruct, ByVal target As Integer, ByVal solutions As Integer, ByVal mode As Integer, ByRef tricks As futureTricks) As Integer End Function <StructLayout(LayoutKind.Explicit)> _ Public Structure dealstruct <FieldOffset(0)> Public trump As Integer <FieldOffset(4)> Public first As Integer

[code].....

After filling in the variables, the double dummy solver is called by:

calldll = SolveBoard(dealStr, target, solutions, mode, futureStr)

With a 32-bits machine this code is functioning correct, but with a 64-bit machine the code generates next error code:

System.TypeLoadException:Could not load type 'Dealstruct' from assembly B-Bridge version 1.1.7, Culture=neutral, PublicKeyToken=null' because an object field at offset 20 that is incorrectly aligned or overlapped by a non-object field.

hich adjustments I have to make to the code so it will function correctly on 64-bit machine.

View 1 Replies

DLL Explicit Run-time Linking?

Feb 25, 2009

What are the main functions needed to create a .dll file in vb.net which needs to be Explicitly linked i.e at run time to an application Plz post me an equivalent code snippet in VB.Net

Explicit run-time linkingDLL files may be explicitly loaded at run-time, a process referred to simply as run-time dynamic linking by Microsoft, by using the LoadLibrary (or LoadLibraryEx) API function. The GetProcAddress API function is used to lookup exported symbols by name, and FreeLibrary — to unload the DLL.

[Code]...

View 2 Replies

Option Explicit Datarow Value?

Jun 14, 2011

If a field called X in a datarow called R is an int32 and Y is an int32 how can I make this statement work:

r!x += y with option strict on.

Error 8 Option Strict On prohibits operands of type Object for operator '+'.

View 6 Replies

Add An Explicit Reference To System.Drawing?

Sep 13, 2011

How do I add an explicit reference to system.drawing in visual basic 2010 express console application?

View 1 Replies

Explicit Add / Remove For Event In Program?

Jan 10, 2011

In C# you can define explicit add/remove code when an event is subscribed/unsubscribed.

Is this possible in VB.net?

View 2 Replies

Explicit Interface Implementation In Program?

Oct 16, 2009

How to implement explicit interface implementation in VB.NET?

View 3 Replies

If A Property Has No Explicit Return What Is It Returning?

Feb 27, 2012

I have some code I inherited which has a lot of warnings that I would like to get removed. Many are of the form Property '<propertyname>' doesn't return a value on all code paths. I know why it is saying this, I'm just trying to determine what the correct 0 impact way of fixing this is.[code]Unfortuantely if I put this in my code (having changed the local variable name to avoid collisions) it then complains that it is being used before it has been assigned a value.Try to analyze IL in LinqPad (not sure if this is a good test or not) reveals that the empty method is the same as the above that Reflector gave me but it is different from return Nothing and return "".What can I use to get rid of this warning while guaranteeing the code runs 100% the same? [code]I'm not sure what ldloc.0 does here. I'm wondering if it is trying to get something from a register which will be null and if that is therefore the same as ldnull in this situation but I havent' ever really studied IL much before...

View 2 Replies

C# - (.net) Is There Any Intrinsic Difference Between .net Explicit Structs And C++ Unions?

Jul 22, 2009

That is the question. Is there anything you can do with c++ unions that you can't with c# Explicit structs?

View 3 Replies

Access A Data Repeater's Item By Index Instead Of Explicit Name?

May 21, 2010

Right now I'm using the following code in my markup[cod]e...

I would like to be able to call it by index instead of explicitly by "SpeakerName". Is there a way to do this in ASP.NET 4.0?

View 1 Replies

Use VB `option` Statements (explicit/infer/strict) In T4 Templates?

Jul 22, 2010

When creating a T4 template in VB.NET, how do you specify Option Explicit, Option Strict,and Option Infer settings? There's some sort of <#@ #> tag for doing this, but I can't find it.

View 1 Replies

Cannot Implicitly Convert Type 'decimal' To 'int'. An Explicit Conversion Exists?

Mar 7, 2009

Cannot implicitly convert type 'decimal' to 'int'. An explicit conversion exists

View 1 Replies

Explicit Call To The Data Source .Insert() Method/event?

May 28, 2009

I need to explicitly load my data source variables and then call the insert method associated with the data source. The sample VB .net code is listed below. So is it sufficient for me to just call the Insert() method when I am ready to insert my values? Or do I need to create an insert event? You see if I look at the properties window for the data source, there is a lightning bolt icon that will generate events for the data source such as Insert,Inserting,Disposing,Init,Load etc.

Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.SqlDataSource1.InsertParameters.Add("@Title", "Mr.")
Me.SqlDataSource1.Insert()

View 1 Replies

Cannot Implicitly Convert Type 'decimal' To 'int'. An Explicit Conversion Exists (are You Missing A Cast?)

Jul 12, 2011

I am calling a GetSerialNo function But it showing some error like:

Cannot implicitly convert type 'decimal' to 'int'. An explicit conversion exists (are you missing a cast?).

Here is the code:

CODE:

View 3 Replies

C# - Does An EventWaitHandle Have Any Implicit MemoryBarrier

Mar 25, 2009

I've frequently coded something along the lines of the sample below(with stuff like Dispose ommited for clarity. ). My question is, are the volatiles needed as shown? Or does the ManualResetEvent.Set have an implicit memory barrier as I've read Thread.Start does? Or would an explicit MemoryBarrier call be better than the volatiles? Or is it completely wrong? Also, the fact that the "implicit memory barrier behavior" in some operations is not documented as far as I've seen is quite frutrating, is there a list of these operations somewhere?

class OneUseBackgroundOp
{
background args[code].....

View 5 Replies

Implicit Conversion Of DataRow?

Feb 19, 2009

I do the following:

Dim rw() as exportDataset.vendorPricingRow = ExportDataset.vendorPricing.Select("field1 = 1")

View 5 Replies

Asp.net - Implicit Line Continuation In VS2010?

Oct 5, 2011

As most of you know, .Net framework 4.0/Visual Studio 2010 supports implicit line continuation in VB, which was not available in previous versions (at least not to my knowledge). I have a situation where I am working on an ASP.Net 3.5 application that is targeting a machine that does not currently have .Net 4.0 installed and from what I understand it won't be installed for some time yet on that machine. Obviously, my development machine does have .net 4.0 installed.

With the implicit line continuation feature in VS2010, I sometimes find myself forgetting to add the continuation, and VS2010 does not have an issue with that even when I am targeting a previous version. Additionally, I know that if I actually compile the code (business objects and such), issues with line continuation are not a problem, as the compiled dll works fine as a 3.5 .net file.

My concern is this. There are areas where I am doing VB.Net coding in the code behind(beside?) for the asp.net pages. These would only be compiled on the server when they are first used, but since the server doesn't have the .net 4.0 framework (or even if it did), does anyone know if this would this cause the compilation to fail if I missed a line continuation? If so, is there a way to enforce using line continuation characters in VS2010?

I realize that some best practices might not be getting followed here, but I'm not about to change all the development dynamics around here just yet. Also, I'm not in an environment where I could easily test this out on my own.

View 1 Replies

C# - Compiler Does Not Do Implicit Casts To Object?

Apr 10, 2011

I've recently had a strange issue with one of my APIs reported. Essentially for some reason when used with VB code the VB compiler does not do implicit casts to Object when trying to invoke the ToString() method.The following is a minimal code example firstly in C# and secondly in VB:

Graph g = new Graph();
g.LoadFromEmbeddedResource("VDS.RDF.Configuration.configuration.ttl");
foreach (Triple t in g.Triples)[code].....

This appears to be due to the fact that the type of the property t.Subject that I am trying to write to the console has explicitly defined ToString() methods which take parameters.The VB compiler appears to expect one of these to be used and does not seem to implicitly cast to Object and use the standard Object.ToString() method whereas the C# compiler does.Is there any way around this e.g. a VB compiler option or is it best just to ensure that the type of the property (which is an interface in this example) explicitly defines an unparameterized ToString() method to ensure compatability with VB?

Graph is an implementation of an interface but that is actually irrelevant since it is the INode interface which is the type that t.Subject returns which is the issue.INode defines two overloads for ToString() both of which take parameters Yes it is a compile time error No I do not use hide-by-name, the API is all written in C# so I couldn't generate that kind of API if I wanted to

Note that I've since added an explicit unparameterized ToString() overload to the interface which has fixed the issue for VB users.

View 2 Replies

Data Loss From Implicit Conversion?

Oct 26, 2010

VB 2008 Express edition. I'm pretty new to VB2008, a little over halfway through my first classi am writing a console program to ask the user for the price of gas for 7 days, then to get the average of that price. here is my code so far:

Option Strict On
Module Module1
Sub Main()

[code].....

View 4 Replies

Defining Implicit Casting Operators?

Aug 21, 2009

In C# you can use the implicit keyword to define an implicit user-defined type conversion operator.In VB.NET you can define a CType conversion operator that will explicitly convert a user-defined type into another type.Is there a way to declare an implicit conversion operator in VB.NET?

View 1 Replies

Forbid Implicit Conversion On Parameter?

Jul 21, 2011

I have 2 methods with the same name, with diferente signatures.

Public Sub Method1(ByVal Parameter1 as String, ByVal Parameter2 as Boolean)
Public Sub Method1(ByVal Parameter1 as Integer, Optional ByVal Parameter2 as Boolean = False, Optional ByVal Parameter3 as Boolean = False)

If I call Method1("My String Parameter", False) it will not give and error, it will try to convert the parameter to integer and use the overload.

Is there a way to forbid the implicit conversion in this specific method or in this specific parameter. For instance, I changed the second method name, but its not an elegant solution.

View 7 Replies

Implicit Conversion From Double To Single

Jun 13, 2011

[Code]...

The code compiles and seems to run correctly, but is underlined with the message "Implicit Conversion from 'Double' to 'Single'" Why would this be an implicit conversion if each of the variables is cast as a Single? Is this something I should worry about or change?

View 2 Replies

Implicit Conversion From String To Boolean?

Nov 10, 2010

I encountered due to a coding error a behaviour I can't explain.In one line I have an implcit conversion from a string to a boolean value:

Class myClass
Public Property myString() as Boolean
Return "123" '<= Implicit Conversion occurs here
End Property
End class

[Code]...

Are there any differences in the behaviour between the .NET Versions?The code is compiled against .NET 2.0 with implicit conversion on.

View 17 Replies

Late Binding - Implicit Casting In .NET?

Apr 12, 2010

The question is intended for lazy VB programmers. In vb I can do and I won't get any errors.

Example 1

Dim x As String = 5
Dim y As Integer = "5"
Dim b As Boolean = "True"

[Code]...

View 4 Replies

C# - Allow Implicit Narrowing Conversion In For Each With Option Strict On?

Dec 1, 2009

VB.Net just showing its true colors again? When I turn Option Strict On, I am still able to do implicit narrowing conversions in a for each loop.For example, this code actually compiles;

Private Sub foobar()
Dim foo() As foo = {New foo}
For Each bar As bar In foo[code].....

From my understanding of Option Strict, this should not work.See here "Restricts implicit data type conversions to only widening conversions".My code above is a narrowing conversion, and so should be illegal.It will fail at runtime with an InvalidCastException.
C# does the same thing. Below is another implicit narrowing conversion.

private void foobar()
{
foo[] foo={new foo()};[code]......

View 8 Replies

C# - Create An Interface In VBNet With Implicit Implimentations?

Nov 6, 2009

In C# I can create an interface, and when I use the interface the compiler knows that certain interface requirements are fulfilled by the base class. This is probably clearer with an example:

[Code]...

On all my forms, or is a better route creating an abstract base class that has SetupForm() (and how do you do that in VB.net)?

View 2 Replies

C# - Runtime InvalidCastException With Implicit Cast Operator?

Oct 13, 2009

I have a C# library that internal clients configure with VB.Net Their scripts are throwing an InvalidCastException where they really shouldn't.

So the code is something like this (massively simplified):

//C#3
public class Foo {
public static implicit operator Foo ( Bar input )

[Code].....

Strange - it looks like the VB.net compiler can find the cast operator but it's lost at runtime. Surely the VB and C# IL will be pretty similar here?

The VB.net code is dynamically compiled - the compile happens the first time a user logs into the app. it's being compiled as VB.Net against .Net 3.5, and I'm not using any COM interop.

View 1 Replies

Create An Interface In VBNet With Implicit Implementations?

Jun 20, 2012

Possible Duplicate: How can I create an interface in VBNet with implicit implimentations I'm normally a C# developer and completely new to VB.NET, so be nice with me.;) Let's say that I have this base class:

[Code]....

Is there any way of not having to use these "proxy"-calls to the real method? I haven't found any useful information about this in the CLI-specification, which makes me suspect that this is a VB.NET "feature". Is this the case?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved