Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Thursday, March 29, 2012

off-the-shelf timekeeping system where we own the code?

I'm looking for an Asp.net (preferably asp.net 2.0) app. we can use to
jump start timekeeping. Has to be able to apply hours to multiple
clients / projects each day, and track the hours, allow total billable
hours to be viewed by managers etc. The basic stuff. Oh yea - and
web based of course.
We'd like to have the code so we can update / change it if necessary.

Anyone have any recommendation?

Jason ShohetThere is a Time Tracker starter kit provided by MS:

http://msdn.microsoft.com/msdnmag/i...08/StarterKits/

"xz" <jasonshohet@.gmail.com> wrote in message
news:1144421182.901230.253000@.g10g2000cwb.googlegr oups.com...
> I'm looking for an Asp.net (preferably asp.net 2.0) app. we can use to
> jump start timekeeping. Has to be able to apply hours to multiple
> clients / projects each day, and track the hours, allow total billable
> hours to be viewed by managers etc. The basic stuff. Oh yea - and
> web based of course.
> We'd like to have the code so we can update / change it if necessary.
> Anyone have any recommendation?
> Jason Shohet

off-the-shelf timekeeping system where we own the code?

I'm looking for an Asp.net (preferably asp.net 2.0) app. we can use to
jump start timekeeping. Has to be able to apply hours to multiple
clients / projects each day, and track the hours, allow total billable
hours to be viewed by managers etc. The basic stuff. Oh yea - and
web based of course.
We'd like to have the code so we can update / change it if necessary.
Anyone have any recommendation?
Jason ShohetThere is a Time Tracker starter kit provided by MS:
http://msdn.microsoft.com/msdnmag/i...08/StarterKits/
"xz" <jasonshohet@.gmail.com> wrote in message
news:1144421182.901230.253000@.g10g2000cwb.googlegroups.com...
> I'm looking for an Asp.net (preferably asp.net 2.0) app. we can use to
> jump start timekeeping. Has to be able to apply hours to multiple
> clients / projects each day, and track the hours, allow total billable
> hours to be viewed by managers etc. The basic stuff. Oh yea - and
> web based of course.
> We'd like to have the code so we can update / change it if necessary.
> Anyone have any recommendation?
> Jason Shohet
>

Monday, March 26, 2012

OK , my dumb question for the day

i have a drop down list fill using the following code:
If IsPostBack Then
'Put user code to initialize the page here
' create a sqlconnection
Dim cnn As SqlConnection = New SqlConnection("Data
Source=localhost;Initial catalog=Northwind;" & _
"Integrated Security=SSPI")
'create a sql command
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = "SELECT * FROM Suppliers"
' Set up the DataAdapter and fill the dataset
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As Suppliers = New Suppliers
da.Fill(ds, "Suppliers")
Dim suppROW As Suppliers.SuppliersRow
For Each suppROW In ds.Suppliers
Me.ddlData.Items.Add(suppROW.SupplierID & suppROW.CompanyName)
Next
i want to set the text of the drop down to companyname
and the value to the supplierID. What am i missing?
thanks
kesHi Kes,
You need to bind the dataset to the dropdown.
Replace this:

> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
With this:
da.Fill(ds, "Suppliers")
ddlData.DataTextField = "CompanyName"
ddlData.DataValueField = "SupplierID"
ddlData.DataSource = dsSuppliers
ddlData.DataBind()
I'm assuming that your Suppliers object is derived from Dataset in the
example above. Good luck! Ken.
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> i have a drop down list fill using the following code:
> If IsPostBack Then
> 'Put user code to initialize the page here
> ' create a sqlconnection
> Dim cnn As SqlConnection = New SqlConnection("Data
> Source=localhost;Initial catalog=Northwind;" & _
> "Integrated Security=SSPI")
> 'create a sql command
> Dim cmd As SqlCommand = cnn.CreateCommand
> cmd.CommandType = Data.CommandType.Text
> cmd.CommandText = "SELECT * FROM Suppliers"
> ' Set up the DataAdapter and fill the dataset
> Dim da As SqlDataAdapter = New SqlDataAdapter
> da.SelectCommand = cmd
> Dim ds As Suppliers = New Suppliers
> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
> i want to set the text of the drop down to companyname
> and the value to the supplierID. What am i missing?
> thanks
> kes
and I knew that!!
I'm working through a book and i got brain lock on this
thanks
kes
"Ken Dopierala Jr." wrote:

> Hi Kes,
> You need to bind the dataset to the dropdown.
> Replace this:
>
> suppROW.CompanyName)
> With this:
> da.Fill(ds, "Suppliers")
> ddlData.DataTextField = "CompanyName"
> ddlData.DataValueField = "SupplierID"
> ddlData.DataSource = dsSuppliers
> ddlData.DataBind()
> I'm assuming that your Suppliers object is derived from Dataset in the
> example above. Good luck! Ken.
> --
> Ken Dopierala Jr.
> For great ASP.Net web hosting try:
> http://www.webhost4life.com/default.asp?refid=Spinlight
> If you sign up under me and need help, email me.
> "WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
> news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> suppROW.CompanyName)
>
>

OK , my dumb question for the day

i have a drop down list fill using the following code:
If IsPostBack Then
'Put user code to initialize the page here
' create a sqlconnection
Dim cnn As SqlConnection = New SqlConnection("Data
Source=localhost;Initial catalog=Northwind;" & _
"Integrated Security=SSPI")
'create a sql command
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = "SELECT * FROM Suppliers"
' Set up the DataAdapter and fill the dataset
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As Suppliers = New Suppliers
da.Fill(ds, "Suppliers")
Dim suppROW As Suppliers.SuppliersRow
For Each suppROW In ds.Suppliers
Me.ddlData.Items.Add(suppROW.SupplierID & suppROW.CompanyName)
Next

i want to set the text of the drop down to companyname
and the value to the supplierID. What am i missing?
thanks
kesHi Kes,

You need to bind the dataset to the dropdown.

Replace this:

> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next

With this:

da.Fill(ds, "Suppliers")
ddlData.DataTextField = "CompanyName"
ddlData.DataValueField = "SupplierID"
ddlData.DataSource = dsSuppliers
ddlData.DataBind()

I'm assuming that your Suppliers object is derived from Dataset in the
example above. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> i have a drop down list fill using the following code:
> If IsPostBack Then
> 'Put user code to initialize the page here
> ' create a sqlconnection
> Dim cnn As SqlConnection = New SqlConnection("Data
> Source=localhost;Initial catalog=Northwind;" & _
> "Integrated Security=SSPI")
> 'create a sql command
> Dim cmd As SqlCommand = cnn.CreateCommand
> cmd.CommandType = Data.CommandType.Text
> cmd.CommandText = "SELECT * FROM Suppliers"
> ' Set up the DataAdapter and fill the dataset
> Dim da As SqlDataAdapter = New SqlDataAdapter
> da.SelectCommand = cmd
> Dim ds As Suppliers = New Suppliers
> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
> i want to set the text of the drop down to companyname
> and the value to the supplierID. What am i missing?
> thanks
> kes
and I knew that!!
I'm working through a book and i got brain lock on this
thanks
kes
"Ken Dopierala Jr." wrote:

> Hi Kes,
> You need to bind the dataset to the dropdown.
> Replace this:
> > da.Fill(ds, "Suppliers")
> > Dim suppROW As Suppliers.SuppliersRow
> > For Each suppROW In ds.Suppliers
> > Me.ddlData.Items.Add(suppROW.SupplierID &
> suppROW.CompanyName)
> > Next
> With this:
> da.Fill(ds, "Suppliers")
> ddlData.DataTextField = "CompanyName"
> ddlData.DataValueField = "SupplierID"
> ddlData.DataSource = dsSuppliers
> ddlData.DataBind()
> I'm assuming that your Suppliers object is derived from Dataset in the
> example above. Good luck! Ken.
> --
> Ken Dopierala Jr.
> For great ASP.Net web hosting try:
> http://www.webhost4life.com/default.asp?refid=Spinlight
> If you sign up under me and need help, email me.
> "WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
> news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> > i have a drop down list fill using the following code:
> > If IsPostBack Then
> > 'Put user code to initialize the page here
> > ' create a sqlconnection
> > Dim cnn As SqlConnection = New SqlConnection("Data
> > Source=localhost;Initial catalog=Northwind;" & _
> > "Integrated Security=SSPI")
> > 'create a sql command
> > Dim cmd As SqlCommand = cnn.CreateCommand
> > cmd.CommandType = Data.CommandType.Text
> > cmd.CommandText = "SELECT * FROM Suppliers"
> > ' Set up the DataAdapter and fill the dataset
> > Dim da As SqlDataAdapter = New SqlDataAdapter
> > da.SelectCommand = cmd
> > Dim ds As Suppliers = New Suppliers
> > da.Fill(ds, "Suppliers")
> > Dim suppROW As Suppliers.SuppliersRow
> > For Each suppROW In ds.Suppliers
> > Me.ddlData.Items.Add(suppROW.SupplierID &
> suppROW.CompanyName)
> > Next
> > i want to set the text of the drop down to companyname
> > and the value to the supplierID. What am i missing?
> > thanks
> > kes
>

Saturday, March 24, 2012

Okay, Ive done some basics... How do I start something?

Basically I want to start writing my first real web application. I want to do something similar to the portal starter kit though I want to code it from scratch (as a means to learn). But there is something that has always bothered me about any project like this... how the heck to you start??

- A pencil and paper with a few rough ideas of how I may want things to work or a full requirements document?
- Start with rough static pages and redo them or build a full section at a time?

Man I hate trying to define a project... I guess its something that comes with practice, but I hate the feeling of not knowing what I am doing or making a huge mistake at the beginning that get too big to fix without throwing most of the work in the bin.

Thoughts? Comments?The best place to start is with the user requirements:
Define them and then refine them.
Always look at the project with the user in mind!
thanks for the reply, however after reading my own post I realised that it wasn't asking what I really wanted to know.
Imagine you've got a spec. Heck you've even got a model. You are now able to open your ide of choice and start coding. Where do you start?

So in my case I want a site with an admin section in which I can alter the layout and content. I want this to have a login required. What part of it would you start to code first?
The three-tier architecture has become very popular of late; it splits an application's
Functionality into three logical tiers, these being:
The Presentation tier
The Business tier
The Data tier
The presentation layer is the user interface the buttons graphics the layout of the page.
The business layer receives requests from the presentation layer and returns a result to the
user depending on the business logic it contains.
The data layer or the database layer is responsible for storing the applications data, and sending it to the business layer when requested.
Information must flow in sequential order between the layers. Which tier you start with is debateable, but normal the data layer is a good place to start!
Hope this helps!
it does indeed, I have something to read up on.

thanks
you're starting at quite a high level- I have been working on a portal from scratch as a kind of learning project so I could practice different things I was working on. It is not an easy thing to do in the least. Get ready to write and rewrite your code, especially since you are just starting out. It won't be perfect the first time, so don't expect it to be. As you learn more, you will realize that what you did a week or month ago was complete crap and you will want to go back and rebuild it.

That being said. Start with the database. You should think about your application and what tables you will need, like the users table for example, and then build you database so you have something to build upon.

When you start with the actual coding, start with the basic framework of the portal- user authentication, role-based login, common admin screen, basic admin functions, then build modules into it...

Good Luck

Okay, how do I get the "name" of the image?...

The following code is supposed to create a rollover image for an ImageButton WebControl that is inside of a Repeater WebControl. The only problem is that it won't work because I don't know how to get the "name" of the image that ASP.NET gives the image at runtime.. Here is the code...


protected void rptrNewReleases_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
ImageButton imgbtnImageButton = (ImageButton)e.Item.FindControl("imgAddToCart");

// (e) needs to be replaced with the "name" this image is given at runtime, but how?
imgbtnImageButton.Attributes.Add("onmouseover", "MM_swapImage('" + (e) + "','','button_addtocart_on.jpg',1)");
imgbtnImageButton.Attributes.Add("onmouseout", "MM_swapImgRestore ()");
}

The name of the image in the first Item is something like name="rptrRepeateRegion:ctl0:imgAddToCartButton"

In the second (Alternating) Item it is name="rptrRepeateRegion:ctl1:imgAddToCartButton"

and so forth...

Is there any function to get this name that ASP.NET creates?

for example: e.Item.ItemName (something like this...)

Thanks (hope this makes sense)Have you tried imgbtnImageButton.ID?

Old code file used when debugging web application

I am developing using VS 2005 SP1. The problem i faced is when debugging is, the debugger seem to be getting the old javascript file even after i clean the solution, rebuild it, restart the computer.Sad

What more do i need to do?
Anyone encounter this problem before?
or is there any place i can delete the file? cause i don't know where the files is resided.

Thanks...

Delete browser cache, temporary internet files from your browser.

Thanks


Dear e_screw,

you were right on...
i have did that before, and did not realized it was the solution.. because i did a few other things as well..

thanks for saving my days...

Old DLL keeps comming back over and over again

I have a solution with about 6 projects (1 web project, 5 control libraries). The code is all source controlled (SVN) and the product is in an ongoing development state.

I am using a 3rd party component which recently upgraded their control from version 5.4.2 to 6.0.0, so naturally I wanted to upgrade the code I have. I open the solution in VS2005 deleted the reference to version 5.4.2 and created a new reference to version 6.0.0 and compiled. I look in the bin and 5.4.2 was just reinstated... from where? and why??

I went into C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\<project name> and cleared everything out, then repeated the steps from above and, low and behold, the 5.4.2 dll just keeps coming back.

I'm at pure frustration at this point. I never ran into situations like this in VS2003... any help would be greatly appreciated!!!!

Hi,

Make sure that version 5.4.2 dll is deleted from all folders in your web project and also delete the VSWebCache folder in Documents & Settings. Also, open your project file in NotePad and check for any references for the old dll. Remove the same if you see any such entry.

Let me know if this works.

Vivek


Hi Vivek,

All 5.4.2 dll's have been deleted, there is no project file for web applications in .NET 2.0 and I can't find the VSWebCache folder in Documents & Settings. Can you give me an exact path?

thanks.


>...there is no project file for web applications in .NET 2.0

Actually your post did not specify if you are using Web Application Project option or not (generally I avoid using the default Website model unless necessary).

In VS 2005, VSWebCache folder is not present under Documents and Settings, I gave you this option as I missed the fact that you are using VS 2005.

Coming back to your problem, if all 5.4.2 dll's have been deleted from your web project, then try to create another test project and see if the same problem occurs. Since in Website model, all files in the project folder are a part of the website, this problem should not have occured. Also try searching for old dll in your entire machine, if found, change its name for the time being.

Let me know if it works.

Vivek


It's all good ;)

I don't know why this was happenning but I found out that it was occuring only in compile time. So I simply removed the reference, added the 6.0.0 dll's manually, and simply opened the web project with my browser and it was good after that.

Strange stuff but I have learned to expect these types of unexplained behaviours from microsoft ;)


thanks again!


I just upgraded the control to version 6.0.2 and I'm going through the same problem AGAIN. I would like to know what is the path the *VS2005* goes through to pick up the dll's, meaning where does it look first, second, third and last before it pulls in old dll's. Can anyone address this issue?

I guess, visual studio .net always looks at the assembly in the bin folder, when it compiles.. Or if you referenced another project, instead of an assembly, then it would get the assembly from its object/debug folder of the referenced project..

Any here is how the runtime locates assemblies during runtime

How the Runtime Locates Assemblies

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp


Is there an equivalent article on msdn2 for .net 2.0?

noamw:

Is there an equivalent article on msdn2 for .net 2.0?

What makes you think the above article doesnt apply for .net 2.0


Good question. I guess my question is more specific and was not aimed at manually loading assemblies. That's why I was hopping to get more info from msdn2...
Anyway, let me try to throw this question out again and hopefully you can help me out.

I have a solution with 6 projects (1 web, 5 library's) and I have a third party component that is referenced both on the web project and in one of the libraries. I recently upgraded to a new version of this component. I did what I have been doing for years now: removed the existing reference, created a new reference to the new version's dll and compiled my solution. The old version kept creeping back into my bin after I compiled. So I took the next step: Cleared all the cache settings, deleted the folder from the Microsoft.Net/Framework/...etc folder (I was under the impression the dll's were cached there) deleted the old version from my bin and re-referenced the new dll in the project. Compiled... the old version somehow found it's way back to my bin.

I would like to know where VS2005 is pulling this dll over and over and over again...

does this make more/any sense now?


You said you are referencing this component in your web project as well as in another library project.. Did you remove the old reference in both the places.. ALso, go to bin/debug or obj/debug folders in both the projects and remove any old dll component and try again

Yes, sorry I forgot to mention this, I did upgrade the dll in both places. Funny thing is that the libraries reference actually held on to the new version. The bin/debug and obj/debug folders were cleared as well. I even ran a "clean solution" just in case and I still get that dll popping back in... it's driving me crazy.

thanks.


Is it possible for you to send us some trimmed down zipped non-working version of your project via email?

-Vivek


As much as it sucks... I can't. sorry :(
I'm having hte same issue. I had to re-chekcout the whole project just to get hte project to relinquish it's grips ont he old dll.? There has to be a reason for this.


Here are some things I've tried and know is a problem.


1) It's not in the GAC, so I don't know where the dll is being cached.

2) We have physically removed the dll from the project and built it. On building, it actually pulls the old version of hte DLL again

3) When we copy and paste the latest version of the DLL, it would actually overwrite the new dll with the old dll.


This is using a webservice, so there is no project file nor could we find where the referneces are that would cause this issue.? I have had this issue a few times now and would love any input people have on this.?

Old Versions of ASPX showing

Hi All,
Here is a long story short.
On one of our IIS platforms, I am running Microsoft CMS, which
utilizes ASP.NET and CSharp.
After changing some code, I noticed that old ASP page code will be
shown/executed when a certain amount of time has elapsed. For
example, if on one page I told it to respond with 'Dog' 3 months ago,
then I changed the code to respond as 'Cat', it responds as 'Cat' for
a bit, then after a time (days/w?), it starts responding with 'Dog'
again, even though the CSharp/ASP pages don't contain 'Dog' anymore.
I assumed this was a caching issue, and recently went into IIS,
Website-->Web Sites-->Home Directory-->Configuration-->Cache Options
and changed from 'Cache limited...', to 'Do not cache ASP...'.
I have yet to see if this will do the trick, but, I was hoping anyone
else could point me in the right direction,if I am doing in the wrong
one.
Thank you in advance.
Dave<goldborder@.gmail.com> wrote in message
news:1173967893.356701.147310@.o5g2000hsb.googlegroups.com...
> Hi All,
> Here is a long story short.
> On one of our IIS platforms, I am running Microsoft CMS, which
> utilizes ASP.NET and CSharp.
> After changing some code, I noticed that old ASP page code will be
> shown/executed when a certain amount of time has elapsed. For
> example, if on one page I told it to respond with 'Dog' 3 months ago,
> then I changed the code to respond as 'Cat', it responds as 'Cat' for
> a bit, then after a time (days/w?), it starts responding with 'Dog'
> again, even though the CSharp/ASP pages don't contain 'Dog' anymore.
> I assumed this was a caching issue, and recently went into IIS,
> Website-->Web Sites-->Home Directory-->Configuration-->Cache Options
> and changed from 'Cache limited...', to 'Do not cache ASP...'.
> I have yet to see if this will do the trick, but, I was hoping anyone
> else could point me in the right direction,if I am doing in the wrong
> one.
> Thank you in advance.
> Dave
You talking classic ASP or ASP.NET here ?
It the former, place this on top of the page
<% Response.CacheControl = "no-cache" %>
Just below the
<%@.LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
Never heard of it caching for months though.
If it's ASP.NET then I usually like to delete the CAC after updating the
site.
Simon

Old Versions of ASPX showing

Hi All,

Here is a long story short.

On one of our IIS platforms, I am running Microsoft CMS, which
utilizes ASP.NET and CSharp.

After changing some code, I noticed that old ASP page code will be
shown/executed when a certain amount of time has elapsed. For
example, if on one page I told it to respond with 'Dog' 3 months ago,
then I changed the code to respond as 'Cat', it responds as 'Cat' for
a bit, then after a time (days/week?), it starts responding with 'Dog'
again, even though the CSharp/ASP pages don't contain 'Dog' anymore.

I assumed this was a caching issue, and recently went into IIS,
Website-->Web Sites-->Home Directory-->Configuration-->Cache Options
and changed from 'Cache limited...', to 'Do not cache ASP...'.

I have yet to see if this will do the trick, but, I was hoping anyone
else could point me in the right direction,if I am doing in the wrong
one.

Thank you in advance.

Dave<goldborder@.gmail.comwrote in message
news:1173967893.356701.147310@.o5g2000hsb.googlegro ups.com...

Quote:

Originally Posted by

Hi All,
>
Here is a long story short.
>
On one of our IIS platforms, I am running Microsoft CMS, which
utilizes ASP.NET and CSharp.
>
After changing some code, I noticed that old ASP page code will be
shown/executed when a certain amount of time has elapsed. For
example, if on one page I told it to respond with 'Dog' 3 months ago,
then I changed the code to respond as 'Cat', it responds as 'Cat' for
a bit, then after a time (days/week?), it starts responding with 'Dog'
again, even though the CSharp/ASP pages don't contain 'Dog' anymore.
>
I assumed this was a caching issue, and recently went into IIS,
Website-->Web Sites-->Home Directory-->Configuration-->Cache Options
and changed from 'Cache limited...', to 'Do not cache ASP...'.
>
I have yet to see if this will do the trick, but, I was hoping anyone
else could point me in the right direction,if I am doing in the wrong
one.
>
Thank you in advance.
>
Dave


You talking classic ASP or ASP.NET here ?
It the former, place this on top of the page
<% Response.CacheControl = "no-cache" %>

Just below the

<%@.LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

Never heard of it caching for months though.

If it's ASP.NET then I usually like to delete the CAC after updating the
site.

--
Simon

OLEDB conn giving error

Hi,
I am facing a problem while trying to execute a simple mdx query using
C# and OLEDB conn.
The code I am using is as:
// Create a OleDb(!!)-connection
OleDbConnection oleDbConn = new OleDbConnection();
// Set the connectionstring
oleDbConn.ConnectionString = "Provider=MSOLAP.2;Data
Source=localhost;Initial Catalog=FoodMart 2000;";
// Creacte a new command
OleDbCommand cmd = new OleDbCommand();
// Assign the connection to the command
cmd.Connection = oleDbConn;
// Assign a query to the commandtext
cmd.CommandText = "SELECT { [Time].&[1997] } ON COLUMNS , {
[Store].[Store State].&[WA] } ON ROWS FROM [Sales] WHERE (
[Customers].[Name].&[1370], [Measures].[Unit Sales] )";
// Open the connection
oleDbConn.Open();
// Execute the reader
OleDbDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
// for each item in the resultset, print the value
for(int i = 0; i < reader.FieldCount; i++)
{
Response.Write(reader.GetValue(i));
}
}
// Don't forget to close the connection
oleDbConn.Close();
This works fine when the 'datasource' specified is 'localhost' but
gives an exception at the 'oleDbConn.Open();' statement when i am using
any other machine name which has analysis sevices.The error is 'No
error information available: E_FAIL(0x80004005)'.
What could be the possible reasons for this.Is it authentication issue?
I dont think there is any problem with connection string.
Please Advice.
Thanks and Regards.does nobody know what to do with this.
Any help!

Thursday, March 22, 2012

OLEDB conn giving error

Hi,

I am facing a problem while trying to execute a simple mdx query using
C# and OLEDB conn.
The code I am using is as:

// Create a OleDb(!!)-connection
OleDbConnection oleDbConn = new OleDbConnection();
// Set the connectionstring
oleDbConn.ConnectionString = "Provider=MSOLAP.2;Data
Source=localhost;Initial Catalog=FoodMart 2000;";
// Creacte a new command
OleDbCommand cmd = new OleDbCommand();
// Assign the connection to the command
cmd.Connection = oleDbConn;
// Assign a query to the commandtext
cmd.CommandText = "SELECT { [Time].&[1997] } ON COLUMNS , {
[Store].[Store State].&[WA] } ON ROWS FROM [Sales] WHERE (
[Customers].[Name].&[1370], [Measures].[Unit Sales] )";
// Open the connection
oleDbConn.Open();
// Execute the reader
OleDbDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
// for each item in the resultset, print the value
for(int i = 0; i < reader.FieldCount; i++)
{
Response.Write(reader.GetValue(i));
}
}
// Don't forget to close the connection
oleDbConn.Close();

This works fine when the 'datasource' specified is 'localhost' but
gives an exception at the 'oleDbConn.Open();' statement when i am using
any other machine name which has analysis sevices.The error is 'No
error information available: E_FAIL(0x80004005)'.
What could be the possible reasons for this.Is it authentication issue?
I dont think there is any problem with connection string.

Please Advice.
Thanks and Regards.does nobody know what to do with this.
Any help!

OLEDB DATAREADER NOT WORKING

Hello, I am using the code down below and I keep receiving the error: No
value given for one or more required parameters.
What am I doing wrong?
protected void dgCustomerSearch_Sort(object sender, EventArgs e)
{
string strCustomerSearchQry;
string strSortExp = dgCustomerSearch.SortExpression.ToString();
strCustomerSearchQry = txtSearchCustomer.Text;
lblCustSrchNotValid.Visible = false;
string srcConString = "Provider=Microsoft.Jet.OleDb.4.0;Data
Source=" + MapPath("cpaneldb.mdb");
OleDbConnection objConString = new OleDbConnection(srcConString);
string srcCmd = "SELECT * FROM tbl_customers WHERE
((tbl_customers.[ID] LIKE '%" + strCustomerSearchQry + "%') OR
(tbl_customers.[LASTNAME] LIKE '%" + strCustomerSearchQry + "%')) ORDER BY
tbl_customers.[" + strSortExp + "]";
objConString.Open();
OleDbCommand objCmd = new OleDbCommand(srcCmd, objConString);
OleDbDataReader objRdr;
objRdr = objCmd.ExecuteReader();
dgCustomerSearch.DataSource = objRdr;
dgCustomerSearch.DataBind();
objRdr.Close();
objConString.Close();
dgCustomerSearch.Visible = true;
}Take the completed srcCmd string, copy it into SQL queryAnalyzer, and execut
e
it.
You will see what is wrong.
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"John Chapman" wrote:

> Hello, I am using the code down below and I keep receiving the error: No
> value given for one or more required parameters.
> What am I doing wrong?
> protected void dgCustomerSearch_Sort(object sender, EventArgs e)
> {
> string strCustomerSearchQry;
> string strSortExp = dgCustomerSearch.SortExpression.ToString();
> strCustomerSearchQry = txtSearchCustomer.Text;
> lblCustSrchNotValid.Visible = false;
> string srcConString = "Provider=Microsoft.Jet.OleDb.4.0;Data
> Source=" + MapPath("cpaneldb.mdb");
> OleDbConnection objConString = new OleDbConnection(srcConString);
> string srcCmd = "SELECT * FROM tbl_customers WHERE
> ((tbl_customers.[ID] LIKE '%" + strCustomerSearchQry + "%') OR
> (tbl_customers.[LASTNAME] LIKE '%" + strCustomerSearchQry + "%')) ORDER BY
> tbl_customers.[" + strSortExp + "]";
> objConString.Open();
> OleDbCommand objCmd = new OleDbCommand(srcCmd, objConString);
> OleDbDataReader objRdr;
> objRdr = objCmd.ExecuteReader();
> dgCustomerSearch.DataSource = objRdr;
> dgCustomerSearch.DataBind();
> objRdr.Close();
> objConString.Close();
> dgCustomerSearch.Visible = true;
> }
>

OLEDB database connection from ASP.NET

I can connect to a Sybase database from a WindowsApp project without
any problems, but when I use the same code to connect from an aspx.vb
file I get an OLEDB exception "Database server not found".
Code is:
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim objDBConn As OleDbConnection
Dim objCommand As OleDbCommand
strConn = "provider=ASAProv;data source=systemsupport"
objDBConn = New OleDbConnection(strConn)
objCommand = New OleDbCommand("spEventLog_Add_2",
objDBConn)
objCommand.CommandType = CommandType.StoredProcedure
objDBConn.Open()
............
If I paste this code into WindowsApp form it runs fine!
Is there something inherently different in the way I should connect to
the database in ASP.
I have the same problem when I call method functions in components
from the ASP that simply return arraylists - they work fine when
called from Windows apps but not when called from the ASP.
Tx,
LouiseASP.NET applications run under the user account ASPNET by default.
I'd say the likely problem is that this user account does not have
permissions to your database.
Either give it permissions or user impersonation to run ASP.NET under a
different user account that has the necessary privileges.
Here's more info:
http://msdn.microsoft.com/library/d...personation.asp
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Louise Hadley" <louise.hadley@.hadleybain.com> wrote in message
news:28d72892.0404161234.6d00cacc@.posting.google.com...
> I can connect to a Sybase database from a WindowsApp project without
> any problems, but when I use the same code to connect from an aspx.vb
> file I get an OLEDB exception "Database server not found".
> Code is:
> Imports System.Data.OleDb
> Public Class WebForm1
> Inherits System.Web.UI.Page
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim strConn As String
> Dim objDBConn As OleDbConnection
> Dim objCommand As OleDbCommand
> strConn = "provider=ASAProv;data source=systemsupport"
> objDBConn = New OleDbConnection(strConn)
> objCommand = New OleDbCommand("spEventLog_Add_2",
> objDBConn)
> objCommand.CommandType = CommandType.StoredProcedure
> objDBConn.Open()
> .............
>
> If I paste this code into WindowsApp form it runs fine!
> Is there something inherently different in the way I should connect to
> the database in ASP.
> I have the same problem when I call method functions in components
> from the ASP that simply return arraylists - they work fine when
> called from Windows apps but not when called from the ASP.
> Tx,
> Louise
Thanks very much Steve, I set up a user ASPNET in my database, and the
connection string "provider=ASAProv;data
source=systemsupport;uid=ASPNET" works!
Phew, now I can relax a bit over the wend - was starting to pull my
hair out!
Louise
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

OLEDB database connection from ASP.NET

I can connect to a Sybase database from a WindowsApp project without
any problems, but when I use the same code to connect from an aspx.vb
file I get an OLEDB exception "Database server not found".

Code is:

Imports System.Data.OleDb

Public Class WebForm1
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim strConn As String
Dim objDBConn As OleDbConnection
Dim objCommand As OleDbCommand

strConn = "provider=ASAProv;data source=systemsupport"

objDBConn = New OleDbConnection(strConn)
objCommand = New OleDbCommand("spEventLog_Add_2",
objDBConn)
objCommand.CommandType = CommandType.StoredProcedure

objDBConn.Open()
.............

If I paste this code into WindowsApp form it runs fine!

Is there something inherently different in the way I should connect to
the database in ASP.

I have the same problem when I call method functions in components
from the ASP that simply return arraylists - they work fine when
called from Windows apps but not when called from the ASP.

Tx,
LouiseASP.NET applications run under the user account ASPNET by default.
I'd say the likely problem is that this user account does not have
permissions to your database.
Either give it permissions or user impersonation to run ASP.NET under a
different user account that has the necessary privileges.
Here's more info:
http://msdn.microsoft.com/library/d...personation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Louise Hadley" <louise.hadley@.hadleybain.com> wrote in message
news:28d72892.0404161234.6d00cacc@.posting.google.c om...
> I can connect to a Sybase database from a WindowsApp project without
> any problems, but when I use the same code to connect from an aspx.vb
> file I get an OLEDB exception "Database server not found".
> Code is:
> Imports System.Data.OleDb
> Public Class WebForm1
> Inherits System.Web.UI.Page
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim strConn As String
> Dim objDBConn As OleDbConnection
> Dim objCommand As OleDbCommand
> strConn = "provider=ASAProv;data source=systemsupport"
> objDBConn = New OleDbConnection(strConn)
> objCommand = New OleDbCommand("spEventLog_Add_2",
> objDBConn)
> objCommand.CommandType = CommandType.StoredProcedure
> objDBConn.Open()
> .............
>
> If I paste this code into WindowsApp form it runs fine!
> Is there something inherently different in the way I should connect to
> the database in ASP.
> I have the same problem when I call method functions in components
> from the ASP that simply return arraylists - they work fine when
> called from Windows apps but not when called from the ASP.
> Tx,
> Louise
Thanks very much Steve, I set up a user ASPNET in my database, and the
connection string "provider=ASAProv;data
source=systemsupport;uid=ASPNET" works!

Phew, now I can relax a bit over the weekend - was starting to pull my
hair out!

Louise

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

OLEDB DATAREADER NOT WORKING

Hello, I am using the code down below and I keep receiving the error: No
value given for one or more required parameters.

What am I doing wrong?

protected void dgCustomerSearch_Sort(object sender, EventArgs e)
{
string strCustomerSearchQry;
string strSortExp = dgCustomerSearch.SortExpression.ToString();
strCustomerSearchQry = txtSearchCustomer.Text;
lblCustSrchNotValid.Visible = false;

string srcConString = "Provider=Microsoft.Jet.OleDb.4.0;Data
Source=" + MapPath("cpaneldb.mdb");
OleDbConnection objConString = new OleDbConnection(srcConString);
string srcCmd = "SELECT * FROM tbl_customers WHERE
((tbl_customers.[ID] LIKE '%" + strCustomerSearchQry + "%') OR
(tbl_customers.[LASTNAME] LIKE '%" + strCustomerSearchQry + "%')) ORDER BY
tbl_customers.[" + strSortExp + "]";
objConString.Open();
OleDbCommand objCmd = new OleDbCommand(srcCmd, objConString);
OleDbDataReader objRdr;
objRdr = objCmd.ExecuteReader();
dgCustomerSearch.DataSource = objRdr;
dgCustomerSearch.DataBind();
objRdr.Close();
objConString.Close();
dgCustomerSearch.Visible = true;
}Take the completed srcCmd string, copy it into SQL queryAnalyzer, and execute
it.
You will see what is wrong.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"John Chapman" wrote:

Quote:

Originally Posted by

Hello, I am using the code down below and I keep receiving the error: No
value given for one or more required parameters.
>
What am I doing wrong?
>
protected void dgCustomerSearch_Sort(object sender, EventArgs e)
{
string strCustomerSearchQry;
string strSortExp = dgCustomerSearch.SortExpression.ToString();
strCustomerSearchQry = txtSearchCustomer.Text;
lblCustSrchNotValid.Visible = false;
>
string srcConString = "Provider=Microsoft.Jet.OleDb.4.0;Data
Source=" + MapPath("cpaneldb.mdb");
OleDbConnection objConString = new OleDbConnection(srcConString);
string srcCmd = "SELECT * FROM tbl_customers WHERE
((tbl_customers.[ID] LIKE '%" + strCustomerSearchQry + "%') OR
(tbl_customers.[LASTNAME] LIKE '%" + strCustomerSearchQry + "%')) ORDER BY
tbl_customers.[" + strSortExp + "]";
objConString.Open();
OleDbCommand objCmd = new OleDbCommand(srcCmd, objConString);
OleDbDataReader objRdr;
objRdr = objCmd.ExecuteReader();
dgCustomerSearch.DataSource = objRdr;
dgCustomerSearch.DataBind();
objRdr.Close();
objConString.Close();
dgCustomerSearch.Visible = true;
}
>


Thank you, I actually found that the issue was that the way I was
retrieving the sort expression returned nothing. So it was looking to sort
by a blank field.

"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.yabbadabbadoo.comwrote in
message news:E76C3BF9-193D-4C3D-8923-39A4B1DEED05@.microsoft.com...

Quote:

Originally Posted by

Take the completed srcCmd string, copy it into SQL queryAnalyzer, and
execute
it.
You will see what is wrong.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"John Chapman" wrote:
>

Quote:

Originally Posted by

>Hello, I am using the code down below and I keep receiving the error: No
>value given for one or more required parameters.
>>
>What am I doing wrong?
>>
>protected void dgCustomerSearch_Sort(object sender, EventArgs e)
> {
> string strCustomerSearchQry;
> string strSortExp = dgCustomerSearch.SortExpression.ToString();
> strCustomerSearchQry = txtSearchCustomer.Text;
> lblCustSrchNotValid.Visible = false;
>>
> string srcConString = "Provider=Microsoft.Jet.OleDb.4.0;Data
>Source=" + MapPath("cpaneldb.mdb");
> OleDbConnection objConString = new OleDbConnection(srcConString);
> string srcCmd = "SELECT * FROM tbl_customers WHERE
>((tbl_customers.[ID] LIKE '%" + strCustomerSearchQry + "%') OR
>(tbl_customers.[LASTNAME] LIKE '%" + strCustomerSearchQry + "%')) ORDER
>BY
>tbl_customers.[" + strSortExp + "]";
> objConString.Open();
> OleDbCommand objCmd = new OleDbCommand(srcCmd, objConString);
> OleDbDataReader objRdr;
> objRdr = objCmd.ExecuteReader();
> dgCustomerSearch.DataSource = objRdr;
> dgCustomerSearch.DataBind();
> objRdr.Close();
> objConString.Close();
> dgCustomerSearch.Visible = true;
> }
>>

OleDb FoxPro Problems!

Hi,

I was using the code below to pull up records from an access database which worked fine, but I now want to do the same to a foxpro 7 database.

It connects to the foxpro dbase but after stepping through the code I found it crashes at

"dgPrevious.DataSource = cmdSelect.ExecuteReader"

the error is "Object reference not set to an instance of an object."

Dim con As OleDb.OleDbConnection
Dim cmdSelect As OleDb.OleDbCommand

Call OpenConnection() ' Own procedure

sqlquery = "SELECT Datereq, NetLogin, Title, Status, RequestId FROM " & tbname

cmdSelect = New OleDb.OleDbCommand(sqlquery, con)

dgPrevious.DataSource = cmdSelect.ExecuteReader

dgPrevious.DataBind()

Thanks

ChrisBy experience I find that if there is a problem with db connection it fails after code for connection but when you apply it.
Can you post the code for Call OpenConnection() ?
I suspect there is a problem here (perhaps).

OleDbConnection - cannot read Excel file

I have the following code in an asp.net page:

System.Data.OleDb.OleDbConnection cn = new
System.Data.OleDb.OleDbConnection();
cn.ConnectionString = @dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\\myservername\ExcelTemp\Temp.xls;Extended Properties=Excel
8.0";
cn.Open();
cn.Close();

My IIS site (on localhost) is set to not allow anonymous users,
integrated security. My web.config has the following for impersonation:

<identity impersonate="true" userName="mydomain\workerprocess"
password="mypassword" /
When running this page, I get the helpful
System.Data.OleDb.OleDbException: Unspecified error. There is no record
in the security Event Log of MyServerName that access was attempted.

When I change web.config to:
<identity impersonate="true" /
I get: System.Data.OleDb.OleDbException: The Microsoft Jet database
engine cannot open the file '\\myservername\ExcelTemp\Temp.xls'. It is
already opened exclusively by another user, or you need permission to
view its data.

The security event log records four back-to-back login success audits
coming from my computer, but the user is ANONYMOUS LOGIN. For example:

Event Type:Success Audit
Event Source:Security
Event Category:Logon/Logoff
Event ID:540
Date:5/12/2006
Time:1:43:31 PM
User:NT AUTHORITY\ANONYMOUS LOGON
Computer:MYSERVERNAME
Description:
Successful Network Logon:
User Name:
Domain:
Logon ID:(0x0,0xA685FE4E)
Logon Type:3
Logon Process:NtLmSsp
Authentication Package:NTLM
Workstation Name:MYCOMPUTERNAME
Logon GUID:-
Caller User Name:-
Caller Domain:-
Caller Logon ID:-
Caller Process ID: -
Transited Services: -
Source Network Address:10.0.100.100
Source Port:0

Any ideas how to actually pass the identity being impersonated through
the OleDbConnection? This application reads several SQL Server
databases and everything is working just fine. But I need to read an
Excel file and can't get it to work. Any help would be greatly
appreciated.As with Access databases, a TEMP directory being used. The account under
which the web site is running will probably need full access to the "TEMP"
directory being used. It may be the one under "documents and
settings"\<machinename>\ASPNET\"Local Settings"\Temp...

--
Brad

"Software is like melted pudding..."
Brad, your suggestion worked. Thank you so much for your help.

Talk about misleading error messages...

Dave

OleDbConnection - cannot read Excel file

I have the following code in an asp.net page:
System.Data.OleDb.OleDbConnection cn = new
System.Data.OleDb.OleDbConnection();
cn.ConnectionString = @dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\\myservername\ExcelTemp\Temp.xls;Extended Properties=Excel
8.0";
cn.Open();
cn.Close();
My IIS site (on localhost) is set to not allow anonymous users,
integrated security. My web.config has the following for impersonation:
<identity impersonate="true" userName="mydomain\workerprocess"
password="mypassword" />
When running this page, I get the helpful
System.Data.OleDb.OleDbException: Unspecified error. There is no record
in the security Event Log of MyServerName that access was attempted.
When I change web.config to:
<identity impersonate="true" />
I get: System.Data.OleDb.OleDbException: The Microsoft Jet database
engine cannot open the file '\\myservername\ExcelTemp\Temp.xls'. It is
already opened exclusively by another user, or you need permission to
view its data.
The security event log records four back-to-back login success audits
coming from my computer, but the user is ANONYMOUS LOGIN. For example:
Event Type: Success Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 540
Date: 5/12/2006
Time: 1:43:31 PM
User: NT AUTHORITY\ANONYMOUS LOGON
Computer: MYSERVERNAME
Description:
Successful Network Logon:
User Name:
Domain:
Logon ID: (0x0,0xA685FE4E)
Logon Type: 3
Logon Process: NtLmSsp
Authentication Package: NTLM
Workstation Name: MYCOMPUTERNAME
Logon GUID: -
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: 10.0.100.100
Source Port: 0
Any ideas how to actually pass the identity being impersonated through
the OleDbConnection? This application reads several SQL Server
databases and everything is working just fine. But I need to read an
Excel file and can't get it to work. Any help would be greatly
appreciated.As with Access databases, a TEMP directory being used. The account under
which the web site is running will probably need full access to the "TEMP"
directory being used. It may be the one under "documents and
settings"\<machinename>\ASPNET\"Local Settings"\Temp...
Brad
"Software is like melted pudding..."
Brad, your suggestion worked. Thank you so much for your help.
Talk about misleading error messages...
Dave

oleDBConnection not recognizing Database

Hi,
I'm using oleDBConnection to connect to SQL server. I keep getting "SQL
Server does not exist" on Open event.
The code I'm using is the following
Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
Source=sqlserver;Database=db;User Id=user;Password=user;")

Can anyone help?

Roger

--
Axiom Software, Ltd.
400 Columbus Ave
Valhalla, NY 10595
(914) 769-8800My Data Source is a machine name. SQL server uses SQL Server and Windows
authentication.

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:eURxE2WbDHA.1816@.TK2MSFTNGP09.phx.gbl...
> The actual message is "SQL Does not exist or access is denied." It could
be
> one or the other. First, your "Data Source" declaration - Is that a
machine
> name there? It has to be either a machine name, domain name, or an IP
> address of the machine hosting the SQL Server. Is it? If so, what
> authentication method is the server using?
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> The more I learn, the less I know.
> "Roger Cantillo" <rogerc@.axiomsw.com> wrote in message
> news:eeuV2VWbDHA.3748@.TK2MSFTNGP11.phx.gbl...
> > Hi,
> > I'm using oleDBConnection to connect to SQL server. I keep getting "SQL
> > Server does not exist" on Open event.
> > The code I'm using is the following
> > Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
> > Source=sqlserver;Database=db;User Id=user;Password=user;")
> > Can anyone help?
> > Roger
> > --
> > Axiom Software, Ltd.
> > 400 Columbus Ave
> > Valhalla, NY 10595
> > (914) 769-8800
Try substituting "Initial Catalog" for "Database" in your Connection String.
Example:

"Provider=sqloledb;Data Source=MachineName;Initial Catalog=Databasename;User
Id=UserName;Password=UserPassword;"

If that doesn't work, one of a couple of things could be wrong:

1. The machine name is not recognized across the network. Try using an IP
address instead. And make sure that the SQL Server is using TCP/IP
2. Your User Name and/or Password are incorrectly typed
3. Your UserName account doesn't have permission to access the database

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Roger Cantillo" <rogerc@.axiomsw.com> wrote in message
news:evhdEuZbDHA.1180@.TK2MSFTNGP11.phx.gbl...
> My Data Source is a machine name. SQL server uses SQL Server and Windows
> authentication.
>
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:eURxE2WbDHA.1816@.TK2MSFTNGP09.phx.gbl...
> > The actual message is "SQL Does not exist or access is denied." It could
> be
> > one or the other. First, your "Data Source" declaration - Is that a
> machine
> > name there? It has to be either a machine name, domain name, or an IP
> > address of the machine hosting the SQL Server. Is it? If so, what
> > authentication method is the server using?
> > --
> > HTH,
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > http://www.takempis.com
> > The more I learn, the less I know.
> > "Roger Cantillo" <rogerc@.axiomsw.com> wrote in message
> > news:eeuV2VWbDHA.3748@.TK2MSFTNGP11.phx.gbl...
> > > Hi,
> > > I'm using oleDBConnection to connect to SQL server. I keep getting
"SQL
> > > Server does not exist" on Open event.
> > > The code I'm using is the following
> > > Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
> > > Source=sqlserver;Database=db;User Id=user;Password=user;")
> > > > > Can anyone help?
> > > > Roger
> > > > --
> > > Axiom Software, Ltd.
> > > 400 Columbus Ave
> > > Valhalla, NY 10595
> > > (914) 769-8800
> >