Showing posts with label correctly. Show all posts
Showing posts with label correctly. Show all posts

Thursday, March 22, 2012

(BUG?)Some JPEGs not showing correctly in PDF-Export

Hi,

we've some pictures from broken machines, they are taken with a digital camera and should be showed within a report.
But some Pictures don't display correctly:
I want to add this image.
In PreviewMode or if exporting to Tif-Images everything looks fine, but if I export to PDF the Image looks like this (resized, but it also looks so if I don't resize it).

If I open the file in Paint.net and save it again everything is okay.. But its strange for the users that this picture shows up correctly everywhere except the PDF-Export. So they say its a problem of PDF export and not of the image..

Does anybody have a similar issue and a solution for this problem?
It doesn't matter if I retrieve the jpeg from a database or from disk, this problem always occurs.
I tried this with and without SP1-> same problem..

Any help would be appreciated
I found the problem by hex-editing the PDF..
Some picutures ( like the one in the link above) get marked as grayscale though they are RGB!!
If you manually change
/XObject /Subtype /Image /ColorSpace /DeviceGray /BitsPerComponent 8 ....
to
/XObject /Subtype /Image /ColorSpace /DeviceRGB /BitsPerComponent 8 ....
and open the PDF the images are okay!

So, thats the bug, but who can give me a solution?
(Editing the PDF afterwards is no solution ;))
|||I analysed the files, the problem seems to occur if the Huffman table marker (FFC4) Header shows up prior the Start of frame marker (FFC0)!
I don't know if the jpegs aren't "well formed" if huffman table marker comes first but other programs process them correctly..

If I manually move the start of frame marker to some position prior the Huffman table marker the pictures show up correctly (the pdf says /DeviceRGB)..
|||We also have noticed this problem, though I don't know my way around Jpeg files well enough to verify the frame sequencing problem you identified above.

I do not believe that we saw this problem until I applied SQL Server 2005 Service Pack 1 last week.

Do you have the service pack applied?
|||

We are also having the same problem and we do have SP1 installed on SQL 2005. Is there still no fix for this issue ? Please help.

|||I've reported that as Bug, take a look at:
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109

MS Comment:
This is a duplicate of https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109. It has been fixed for the upcoming Service Pack 2.

It's a duplicate of itself;) But they seem to fix it..

(BUG?)Some JPEGs not showing correctly in PDF-Export

Hi,

we've some pictures from broken machines, they are taken with a digital camera and should be showed within a report.
But some Pictures don't display correctly:
I want to add this image.
In PreviewMode or if exporting to Tif-Images everything looks fine, but if I export to PDF the Image looks like this (resized, but it also looks so if I don't resize it).

If I open the file in Paint.net and save it again everything is okay.. But its strange for the users that this picture shows up correctly everywhere except the PDF-Export. So they say its a problem of PDF export and not of the image..

Does anybody have a similar issue and a solution for this problem?
It doesn't matter if I retrieve the jpeg from a database or from disk, this problem always occurs.
I tried this with and without SP1-> same problem..

Any help would be appreciatedI found the problem by hex-editing the PDF..
Some picutures ( like the one in the link above) get marked as grayscale though they are RGB!!
If you manually change
/XObject /Subtype /Image /ColorSpace /DeviceGray /BitsPerComponent 8 ....
to
/XObject /Subtype /Image /ColorSpace /DeviceRGB /BitsPerComponent 8 ....
and open the PDF the images are okay!

So, thats the bug, but who can give me a solution?
(Editing the PDF afterwards is no solution ;))|||I analysed the files, the problem seems to occur if the Huffman table marker (FFC4) Header shows up prior the Start of frame marker (FFC0)!
I don't know if the jpegs aren't "well formed" if huffman table marker comes first but other programs process them correctly..

If I manually move the start of frame marker to some position prior the Huffman table marker the pictures show up correctly (the pdf says /DeviceRGB)..|||We also have noticed this problem, though I don't know my way around Jpeg files well enough to verify the frame sequencing problem you identified above.

I do not believe that we saw this problem until I applied SQL Server 2005 Service Pack 1 last week.

Do you have the service pack applied?|||

We are also having the same problem and we do have SP1 installed on SQL 2005. Is there still no fix for this issue ? Please help.

|||I've reported that as Bug, take a look at:
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109

MS Comment:
This is a duplicate of

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109.

It has been fixed for the upcoming Service Pack 2.

It's a duplicate of itself;) But they seem to fix it..

(BUG?)Some JPEGs not showing correctly in PDF-Export

Hi,

we've some pictures from broken machines, they are taken with a digital camera and should be showed within a report.
But some Pictures don't display correctly:
I want to add this image.
In PreviewMode or if exporting to Tif-Images everything looks fine, but if I export to PDF the Image looks like this (resized, but it also looks so if I don't resize it).

If I open the file in Paint.net and save it again everything is okay.. But its strange for the users that this picture shows up correctly everywhere except the PDF-Export. So they say its a problem of PDF export and not of the image..

Does anybody have a similar issue and a solution for this problem?
It doesn't matter if I retrieve the jpeg from a database or from disk, this problem always occurs.
I tried this with and without SP1-> same problem..

Any help would be appreciatedI found the problem by hex-editing the PDF..
Some picutures ( like the one in the link above) get marked as grayscale though they are RGB!!
If you manually change
/XObject /Subtype /Image /ColorSpace /DeviceGray /BitsPerComponent 8 ....
to
/XObject /Subtype /Image /ColorSpace /DeviceRGB /BitsPerComponent 8 ....
and open the PDF the images are okay!

So, thats the bug, but who can give me a solution?
(Editing the PDF afterwards is no solution ;))|||I analysed the files, the problem seems to occur if the Huffman table marker (FFC4) Header shows up prior the Start of frame marker (FFC0)!
I don't know if the jpegs aren't "well formed" if huffman table marker comes first but other programs process them correctly..

If I manually move the start of frame marker to some position prior the Huffman table marker the pictures show up correctly (the pdf says /DeviceRGB)..|||We also have noticed this problem, though I don't know my way around Jpeg files well enough to verify the frame sequencing problem you identified above.

I do not believe that we saw this problem until I applied SQL Server 2005 Service Pack 1 last week.

Do you have the service pack applied?|||

We are also having the same problem and we do have SP1 installed on SQL 2005. Is there still no fix for this issue ? Please help.

|||I've reported that as Bug, take a look at:
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109

MS Comment:
This is a duplicate of

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=152109.

It has been fixed for the upcoming Service Pack 2.

It's a duplicate of itself;) But they seem to fix it..sql

((cdate("1/1/2001")+30) as task_due_date (Not working)

I have the below function written in VB, and everything works fine
EXCEPT that the sql code is not executing correctly. The date field is
in the table always shows "12/1/1899 11:59:17 PM" no other date. I'm
should have the date of the input into the function + or - the integer
in the task_due_days field.

for example (cdate("1/1/2002")+30) as task_due_date

What am I doing wrong?

Function SetTasks(trans_id As Long, trans_type As Integer, event_date
As Date)

Dim task As String

task = "Insert into tbl_tasks
(trans_id,task_name,Task_due_date,comments) SELECT (" & trans_id & ")
as trans_id,task_name,(cdate(" & event_date & ")+[task_due_days]) as
task_due_date,comments FROM tbl_task_parameter WHERE trans_type=" &
trans_type

Debug.Print task

DoCmd.RunSQL (task)

End Function

the actual SQL code is....

Insert into tbl_tasks (trans_id,task_name,Task_due_date,comments)
SELECT (192) as trans_id,task_name,(cdate(1/1/2001)+[task_due_days]) as
task_due_date,comments FROM tbl_task_parameter WHERE trans_type=1

ANY HELP IS GREATLY APPRECIATED!(stoppal@.hotmail.com) writes:
> the actual SQL code is....
> Insert into tbl_tasks (trans_id,task_name,Task_due_date,comments)
> SELECT (192) as trans_id,task_name,(cdate(1/1/2001)+[task_due_days]) as
> task_due_date,comments FROM tbl_task_parameter WHERE trans_type=1

Apparently you are not using SQL Server, as there is no cdate function
in SQL Serever.

I can tell what the problem is though: 1/1/2001 = 0 with integer division,
and with floating-point division you get 0.0005. Since you got
11:59:17, I guess that in whatever you are using, you have floating-
point division. (In SQL Server you would get integer division here.)

So you need to delimit the date string. In SQL Server that would be
'1/1/2001'. But it looks a bit likely you are using Access, in which
case maybe ## is better. But you better ask in comp.databases.ms-access
it you are uncertain.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.aspsql

Thursday, February 16, 2012

<asp:SqlDataSource> need a look over to see If I am writing this correctly.

This is a subset question of one of my other threads, the gist is while using forms authentication, I am trying to enter additional information into another table on the same db as the aspnet_membership tables. I think I need an <asp:SqlDataSource> to do this because it is about the only thing left I haven't tried to get this code to work so any help is appreciated. Environment: sql server 2000, windows server 2003, asp.net 2.0, vb, no GUI

<ASP:SqlDataSource id="addedInfo" ConnectionString="<%$ ConnectionStrings:SqlServerConnection %>" InsertCommand="INSERT INTO addInfo(username,email,company,firstname,lastname,phone) VALUES (@.username,@.email,@.company,@.firstname,@.lastname,@.phone)" runat="server" />

looking over some of my books and online it says in the connectionStrings that it is supposed to be the database name that goes next to the : but when I try that I get an error that it is looking for the name of the connection string, so I enter the name of the connection string (as above) and nothing happens, which is basically the ongoing event with this whole problem, the form fields (username, email, password) that go into the aspnet_membership tables just fine, I don't have any problems with those, it is getting the additional information into another table that has been stalling me the whole time.

So does this sqldatasource look right? Any help is appreciated.

this is the full page of register.aspx

<%@. Page Explicit="true" debug="true" language="vb" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data.Mail" %>
<%@. Import Namespace="System.Net.Mail" %>

<script runat="server">

Public Sub CreateUser_OnClick(sender As Object, args As EventArgs)
Dim result As MembershipCreateStatus
Try
' Create new user.

Dim newUser As MembershipUser
If Membership.RequiresQuestionAndAnswer Then
newUser = Membership.CreateUser(UsernameTextbox.Text,PasswordTextbox.Text,EmailTextbox.Text,PasswordQuestionTextbox.Text, PasswordAnswerTextbox.Text,false,result)
Else
newUser = Membership.CreateUser(UsernameTextbox.Text,PasswordTextbox.Text,EmailTextbox.Text)
End If


Response.Redirect("login.aspx")

Catch e As MembershipCreateUserException
Msg.Text = GetErrorMessage(e.StatusCode)
Catch e As HttpException
Msg.Text = e.Message
End Try
End Sub

Public Function GetErrorMessage(status As MembershipCreateStatus) As String

Select Case status
Case MembershipCreateStatus.DuplicateUserName
Return "Username already exists. Please enter a different user name."

Case MembershipCreateStatus.DuplicateEmail
Return "A username for that e-mail address already exists. Please enter a different e-mail address."

Case MembershipCreateStatus.InvalidPassword
Return "The password provided is invalid. Please enter a valid password value."

Case MembershipCreateStatus.InvalidEmail
Return "The e-mail address provided is invalid. Please check the value and try again."

Case MembershipCreateStatus.InvalidAnswer
Return "The password retrieval answer provided is invalid. Please check the value and try again."

Case MembershipCreateStatus.InvalidQuestion
Return "The password retrieval question provided is invalid. Please check the value and try again."

Case MembershipCreateStatus.InvalidUserName
Return "The user name provided is invalid. Please check the value and try again."

Case MembershipCreateStatus.ProviderError
Return "The authentication provider Returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."

Case MembershipCreateStatus.UserRejected
Return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."

Case Else
Return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."
End Select
End Function

</script>

<form runat="server" id="form1">
<h3>Create New User</h3>

<asp:Label id="Msg" ForeColor="maroon" runat="server" /><BR>

<table CellPadding="3" border="0">
<tr>
<td><span class="style5">Username:</span></td>
<td><asp:Textbox id="UsernameTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="UsernameRequiredValidator" runat="server"
ControlToValidate="UserNameTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Password:</span></td>
<td><asp:Textbox id="PasswordTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordRequiredValidator" runat="server"
ControlToValidate="PasswordTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Confirm Password:</span></td>
<td><asp:Textbox id="PasswordConfirmTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordConfirmRequiredValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" />
<asp:CompareValidator id="PasswordConfirmCompareValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ControlToCompare="PasswordTextBox"
ErrorMessage="Confirm password must match password." /> </td>
</tr>
<tr>
<td><span class="style5">Email Address:</span></td>
<td><asp:Textbox id="EmailTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="EmailRequiredValidator" runat="server"
ControlToValidate="EmailTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>


<% If Membership.RequiresQuestionAndAnswer Then %>

<tr>
<td>Password Question:</td>
<td><asp:Textbox id="PasswordQuestionTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordQuestionRequiredValidator" runat="server"
ControlToValidate="PasswordQuestionTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td>Password Answer:</td>
<td><asp:Textbox id="PasswordAnswerTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordAnswerRequiredValidator" runat="server"
ControlToValidate="PasswordAnswerTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<% End If %>
</table>
<!-- so much trouble below! -->
<table cellpadding="3" cellspacing="0">
<tr>
<td width="122"><span class="style5">Company:</span>
</td>
<td width="144"><asp:Textbox id="CompanyTextbox" runat="server" /></td>
<td width="387"><asp:RequiredFieldValidator id="CompanyValidator" runat="server" ControlToValidate="CompanyTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">First Name:</span></td>
<td><asp:Textbox id="FirstNameTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="FirstNameValidator" runat="server" ControlToValidate="FirstNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Last Name:</span> </td>
<td><asp:Textbox id="LastNameTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="LastNameValidator" runat="server" ControlToValidate="LastNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Phone Number:</span> </td>
<td><asp:Textbox id="PhoneTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PhoneValidator" runat="server" ControlToValidate="PhoneTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" />
<ASP:SqlDataSource id="addedInfo" ConnectionString="<%$ ConnectionStrings:SqlElectron %>" InsertCommand="INSERT INTO addInfo(username,email,company,firstname,lastname,phone) VALUES (UserNameTextbox,EmailTextbox,CompanyTextbox,FirstNameTextbox,LastNameTextbox,PhoneTextbox)" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td><asp:Button id="CreateUserButton" CssClass="style5" Text="Create User" OnClick="CreateUser_OnClick" runat="server" /></td>
</tr>
</table>
</form>

From some tests right now the entire code is just being ignored. I've tried to break this by intentionally adding fields that don't exist into the add so that it would return (I forget what it is precisily called) the error where it says that the fields being entered do not match the database. As always any help is appreciated.

|||

For a minute there thought I actually figured out what I didn't do, I didn't add the DataSourceID to the textboxes, so I added it and nothing happens still the same problem :( So below is the current version of the code:

<form runat="server" id="form1">
<h3>Create New User</h3>

<asp:Label id="Msg" ForeColor="maroon" runat="server" /><BR>

<table CellPadding="3" border="0">
<tr>
<td><span class="style5">Username:</span></td>
<td><asp:Textbox id="UsernameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="UsernameRequiredValidator" runat="server"
ControlToValidate="UserNameTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Password:</span></td>
<td><asp:Textbox id="PasswordTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordRequiredValidator" runat="server"
ControlToValidate="PasswordTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Confirm Password:</span></td>
<td><asp:Textbox id="PasswordConfirmTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordConfirmRequiredValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" />
<asp:CompareValidator id="PasswordConfirmCompareValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ControlToCompare="PasswordTextBox"
ErrorMessage="Confirm password must match password." /> </td>
</tr>
<tr>
<td><span class="style5">Email Address:</span></td>
<td><asp:Textbox id="EmailTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="EmailRequiredValidator" runat="server"
ControlToValidate="EmailTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>


<% If Membership.RequiresQuestionAndAnswer Then %>

<tr>
<td>Password Question:</td>
<td><asp:Textbox id="PasswordQuestionTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordQuestionRequiredValidator" runat="server"
ControlToValidate="PasswordQuestionTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td>Password Answer:</td>
<td><asp:Textbox id="PasswordAnswerTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordAnswerRequiredValidator" runat="server"
ControlToValidate="PasswordAnswerTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<% End If %>
</table>
<!-- so much trouble below! -->
<table cellpadding="3" cellspacing="0">
<tr>
<td width="122"><span class="style5">Company:</span>
</td>
<td width="144"><asp:Textbox id="CompanyTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td width="387"><asp:RequiredFieldValidator id="CompanyValidator" runat="server" ControlToValidate="CompanyTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">First Name:</span></td>
<td><asp:Textbox id="FirstNameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="FirstNameValidator" runat="server" ControlToValidate="FirstNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Last Name:</span> </td>
<td><asp:Textbox id="LastNameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="LastNameValidator" runat="server" ControlToValidate="LastNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Phone Number:</span> </td>
<td><asp:Textbox id="PhoneTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="PhoneValidator" runat="server" ControlToValidate="PhoneTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" />
<asp:SqlDataSource id="addedInfo" ConnectionString="<%$ ConnectionStrings:SqlElectron %>" InsertCommand="INSERT INTO addInfo(username,email,company,firstname,lastname,phone) VALUES (UserNameTextbox,EmailTextbox,CompanyTextbox,FirstNameTextbox,LastNameTextbox,PhoneTextbox)" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td><asp:Button id="CreateUserButton" CssClass="style5" Text="Create User" OnClick="CreateUser_OnClick" runat="server" /></td>
</tr>
</table>
</form>

any help is appreciated. I've been working on this problem now for the better part of two weeks, and I am simply out of ideas as to the problem.

|||

For a minute there thought I actually figured out what I didn't do, I didn't add the DataSourceID to the textboxes, so I added it and nothing happens still the same problem :( So below is the current version of the code:

<form runat="server" id="form1">
<h3>Create New User</h3>

<asp:Label id="Msg" ForeColor="maroon" runat="server" /><BR>

<table CellPadding="3" border="0">
<tr>
<td><span class="style5">Username:</span></td>
<td><asp:Textbox id="UsernameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="UsernameRequiredValidator" runat="server"
ControlToValidate="UserNameTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Password:</span></td>
<td><asp:Textbox id="PasswordTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordRequiredValidator" runat="server"
ControlToValidate="PasswordTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Confirm Password:</span></td>
<td><asp:Textbox id="PasswordConfirmTextbox" runat="server" TextMode="Password" /></td>
<td><asp:RequiredFieldValidator id="PasswordConfirmRequiredValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" />
<asp:CompareValidator id="PasswordConfirmCompareValidator" runat="server"
ControlToValidate="PasswordConfirmTextbox" ForeColor="red"
Display="Static" ControlToCompare="PasswordTextBox"
ErrorMessage="Confirm password must match password." /> </td>
</tr>
<tr>
<td><span class="style5">Email Address:</span></td>
<td><asp:Textbox id="EmailTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="EmailRequiredValidator" runat="server"
ControlToValidate="EmailTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>


<% If Membership.RequiresQuestionAndAnswer Then %>

<tr>
<td>Password Question:</td>
<td><asp:Textbox id="PasswordQuestionTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordQuestionRequiredValidator" runat="server"
ControlToValidate="PasswordQuestionTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td>Password Answer:</td>
<td><asp:Textbox id="PasswordAnswerTextbox" runat="server" /></td>
<td><asp:RequiredFieldValidator id="PasswordAnswerRequiredValidator" runat="server"
ControlToValidate="PasswordAnswerTextbox" ForeColor="red"
Display="Static" ErrorMessage="Required" /></td>
</tr>
<% End If %>
</table>
<!-- so much trouble below! -->
<table cellpadding="3" cellspacing="0">
<tr>
<td width="122"><span class="style5">Company:</span>
</td>
<td width="144"><asp:Textbox id="CompanyTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td width="387"><asp:RequiredFieldValidator id="CompanyValidator" runat="server" ControlToValidate="CompanyTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">First Name:</span></td>
<td><asp:Textbox id="FirstNameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="FirstNameValidator" runat="server" ControlToValidate="FirstNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Last Name:</span> </td>
<td><asp:Textbox id="LastNameTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="LastNameValidator" runat="server" ControlToValidate="LastNameTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" /></td>
</tr>
<tr>
<td><span class="style5">Phone Number:</span> </td>
<td><asp:Textbox id="PhoneTextbox" runat="server" DataSourceID="addedInfo" /></td>
<td><asp:RequiredFieldValidator id="PhoneValidator" runat="server" ControlToValidate="PhoneTextbox" ForeColor="red" Display="Static" ErrorMessage="Required" />
<asp:SqlDataSource id="addedInfo" ConnectionString="<%$ ConnectionStrings:SqlElectron %>" InsertCommand="INSERT INTO addInfo(username,email,company,firstname,lastname,phone) VALUES (UserNameTextbox,EmailTextbox,CompanyTextbox,FirstNameTextbox,LastNameTextbox,PhoneTextbox)" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td><asp:Button id="CreateUserButton" CssClass="style5" Text="Create User" OnClick="CreateUser_OnClick" runat="server" /></td>
</tr>
</table>
</form>

any help is appreciated. I've been working on this problem now for the better part of two weeks, and I am simply out of ideas as to the problem.

|||

Public Sub CreateUser_OnClick(sender As Object, args As EventArgs)
Dim result As MembershipCreateStatus
Try
' Create new user.

Dim newUser As MembershipUser
If Membership.RequiresQuestionAndAnswer Then
newUser = Membership.CreateUser(UsernameTextbox.Text,PasswordTextbox.Text,EmailTextbox.Text,PasswordQuestionTextbox.Text, PasswordAnswerTextbox.Text,false,result)
Else
newUser = Membership.CreateUser(UsernameTextbox.Text,PasswordTextbox.Text,EmailTextbox.Text)
End If

dim conn as new sqlconnection(system.configuration.configurationmanager.connectionstrings("SqlElectron").connectionstring)

dim cmd as new sqlcommand("INSERT INTO addInfo(username,email,company,firstname,lastname,phone) VALUES (@.UserNameTextbox,@.EmailTextbox,@.CompanyTextbox,@.FirstNameTextbox,@.LastNameTextbox,@.PhoneTextbox)",conn)

cmd.parameters.add("@.UserNameTextbox",varchar).value=UsernameTextbox.Text

cmd.parameters.add("@.EmailTextbox",varchar).value=EmailTextbox.Text

{Add rest of fields here}

conn.open

cmd.executenonquery

conn.close

Response.Redirect("login.aspx")

Catch e As MembershipCreateUserException
Msg.Text = GetErrorMessage(e.StatusCode)
Catch e As HttpException
Msg.Text = e.Message
End Try
End Sub

|||

First thanks for the help moley

second the code errors out with two errors first it needs varchar set to a value and the connection string it saysSystem.NullReferenceException: Object reference not set to an instance of an object.

I'm working on a variant of what you posted and Ill post it as soon as I get it done with whether it works or not.

|||yep it gives me the beginning of the findcontrol loop logic error that I have in one of my other threadshttp://forums.asp.net/2/1381460/ShowThread.aspx . basically

No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.ArgumentException: No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type.

Source Error:

Line 37: Line 38: SQLConn.Open()Line 39: cmd.ExecuteNonQueryLine 40: SQLConn.CloseLine 41:


Source File:C:\Inetpub\wwwroot\login\register.aspx Line:39

It can never find the value of the textboxes because the textboxes get wiped out in the process of the membership being made, If I try to put this type of code before the membership stuff it will not find anything, If I use findcontrol() to try and extract the value it will return with nothing and thus I return to my two week+ nightmare of trying to get this to work. I assumed since I needed to trap the info that I could use the <asp:SqlDataSource to do that and then send it's insert seperatly but I guess that doesn't work.

For those forum members that have a custom registration page (basically something that adds more fields than what is in the CreateUserWizard) how do you enter those fields? I honest to gawd don't know what I am missing but basically I have tried every code example I could come across, I've tried everything other forumers have tried, I just have no idea what I am missing or not doing? I can enter the basic forms data fine (username, email, password) that enters the aspnet_membership tabels fine but I can get nothing into the addInfo table that I have in the same database. Any help is appreciated and thanks to everyone who has been helping me.

|||

The big error:

You forgot to supply .Text when assigning the value to one of the parameters.

First error:

Change:

cmd.parameters.add("@.UserNameTextbox",varchar).value=UsernameTextbox.Text

to:

cmd.Parameters.Add("@.UserNameTextbox",sqldbtype.varchar).Value=UsernameTextbox.Text

varchar isn't a variable, it's a value from the system.data.sqldbtype enumeration.

--

Second Error:

Please post your web.config file (Please make sure you remove any passwords by using XXXXXXXX instead of the real password before posting).

|||

<configuration>
<appSettings>
<add key="ConnectionString" value="DataSource=mew@.mew.com;UID=bark;pwd=xxxxxxxxx" />
<add key="ConnectionString" value="Server=xxx.xxx.xxx.xxx;database=customerlogin;UID=yyyyyyyy;pwd=xxxxxxxx;Trusted_Connection=True" />
</appSettings>
<connectionStrings>
<add name="SqlServerConnection" connectionString="Server=xxx.xxx.xxx.xxx;database=customerlogin;UID=yyyyyyyy;pwd=xxxxxxxx;Trusted_Connection=True" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=xxx.xxx.xxx.xxx;Integrated Security=SSPI;Initial Catalog=customerlogin;UID=yyyyyyyyy;pwd=xxxxxxxxx;Trusted_Connection=True" />
</connectionStrings>
<location path="lock">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
<system.web>
<authentication mode="Forms">
<forms cookieless="AutoDetect" defaultUrl="~\lock\library.aspx" loginUrl="../login.aspx" name=".ASPXAUTH" />
</authentication>
</system.web>
<system.web>
<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider" type="System.Web.Security.SqlMembershipProvider" passwordFormat="Clear" connectionStringName="LocalSqlServer" requiresQuestionAndAnswer="false" />
</providers>
</membership>
</system.web>
<system.web>
<profile enabled="true">
<properties>
<add name="company" type="String" />
<add name="firstname" type="String"/>
<add name="lastname" type="String"/>
<add name="phone" type="String" />
</properties>
</profile>
</system.web>
</location>
</configuration>

The highlighted UID's are the same and thus consequently the passwords are the same. I removed the SqlElectron from the previous examples since making a second account didn't help the matter and have gone back to alternating between the SqlServerConnection and LocalSqlServer connections depending on what variable I am testing. Thanks for the help Motley.

|||

Here:

PrivateFunction SuperFindControl(ByVal ctrlAsString,OptionalByVal basectrlAs Control =Nothing)As Control

If basectrlIsNothingThen

basectrl = Page

EndIf

If basectrl.Controls.Count > 0Then

ForEach cAs ControlIn basectrl.Controls

If c.IDIsNotNothingAndAlso c.ID.ToLower = ctrl.ToLowerThen

Return c

Else

If c.Controls.Count > 0Then

Dim c2As Control = SuperFindControl(ctrl, c)

IfNot c2IsNothingThen

Return c2

EndIf

EndIf

EndIf

Next

EndIf

ReturnNothing

EndFunction

Now you can reference your control as SuperFindControl("txtCompanyTextBox") anywhere in your code -- but it will only return the first one it finds with that id if you have more than one.

|||

Motley:

The big error:

You forgot to supply .Text when assigning the value to one of the parameters.

First error:

Change:

cmd.parameters.add("@.UserNameTextbox",varchar).value=UsernameTextbox.Text

to:

cmd.Parameters.Add("@.UserNameTextbox",sqldbtype.varchar).Value=UsernameTextbox.Text

varchar isn't a variable, it's a value from the system.data.sqldbtype enumeration.

--

Second Error:

Please post your web.config file (Please make sure you remove any passwords by using XXXXXXXX instead of the real password before posting).

W00T it works! The highlighted ontop of whatever other changes I've made(ill have to break the page to find out what actually did it) have worked, I get the additional info in the new table and everything works well, Thanks a lot Motley you have been a lifesaver, and more than likely helped me keep my job. I would give you a hug but we dont know each other well enough lol, so

/e handshake

Thanks a lot.

|||

Now only one problem left to fix, but now I can close three threads that were all related to each other.

Login.aspx I'm looking at you next!

Thanks again Motley.

|||

Given your web.config file, the connection should be:

dim conn as new sqlconnection(system.configuration.configurationmanager.connectionstrings("LocalSqlServer").connectionstring)

<<SQL2k5>>

Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and functioning
correctly on 1 box?
TIA> Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and
functioning
> correctly on 1 box?
From
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp:
Multiple SQL Server 2005 Express installations can coexist on the same
machine along with other installations of SQL Server 2000, SQL Server 2005,
or Microsoft Desktop Engine (MSDE). In general, it is best that SQL Server
2000 instances be upgraded to SP3a or higher. The maximum limit to the
number of SQL instances is 50 on the same machine. These instances must be
uniquely named for the purpose of identifying them.
Still, be aware that SQL 2005 is in Beta version, so you might experience
problems. I prefer installing beta versions in a virtual machine.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

Saturday, February 11, 2012

#Temp table question

I'm not sure if I understood this correctly.
If I create a temporary table with the name #SomeTempTab,
can anybody else see this table while I'm using it and before I drop it.
So if two users at the same time trying to create the table with this name
will they be different for each user or there will be a conflict?
Thanks,
Michael
On Fri, 31 Dec 2004 16:12:06 -0800, MichaelK wrote:

>I'm not sure if I understood this correctly.
>If I create a temporary table with the name #SomeTempTab,
>can anybody else see this table while I'm using it and before I drop it.
>So if two users at the same time trying to create the table with this name
>will they be different for each user or there will be a conflict?
Hi Michael,
There will be no conflict. SQL Server will generate a connection-specific
suffix to create a really unique table name in tempdb. Everytime you refer
to #SomeTempTab, SQL Server will append the suffix and look in "your"
version of the temporary table.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Thanks Hugo.
You were helpfull as well as with my another question.
It's what I was looking for.
Regards,
Michael
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:ej7et0980uvbk8n3nheabcvn0lfq57as4a@.4ax.com...
> On Fri, 31 Dec 2004 16:12:06 -0800, MichaelK wrote:
>
> Hi Michael,
> There will be no conflict. SQL Server will generate a connection-specific
> suffix to create a really unique table name in tempdb. Everytime you refer
> to #SomeTempTab, SQL Server will append the suffix and look in "your"
> version of the temporary table.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)

Thursday, February 9, 2012

# of SQL 2000 Databases

Is there a limit to the number of SQL databases you can
have on one server? If I remember correctly it depends
only on space and memory. We currently have 49 databases
running on one server and we are continueing to grow. The
server is running fine as far as memory goes and we have
plenty of space but I wanted to make sure we don't have a
limit as far as the amount of databases we are aloud on
one server.Books Online, Maximum Capacity Specifications, say that the max number is
32,767 per instance. So you are quite far from limit...
--
Dejan Sarka, SQL Server MVP
Please reply only to the newsgroups.
"Shannon" <anonymous@.discussions.microsoft.com> wrote in message
news:06e701c3aeaf$a6ec9c20$a001280a@.phx.gbl...
> Is there a limit to the number of SQL databases you can
> have on one server? If I remember correctly it depends
> only on space and memory. We currently have 49 databases
> running on one server and we are continueing to grow. The
> server is running fine as far as memory goes and we have
> plenty of space but I wanted to make sure we don't have a
> limit as far as the amount of databases we are aloud on
> one server.|||See the topic "Maximum Capacity Specifications" in SQL
Server Books ONline. The documented limit noted there is
32767.
In theory you're only limited to memory, I/O, processor,
etc., but also think about manageability: do you actually
WANT to manage 1000 databases under one instance?
If you're interested in things like this, which is more of
a consolidation scenario, I suggest you look at the
Planning for SQL 2K Consolidation whitepaper since it
talks about the combined gotchas.
>--Original Message--
>Is there a limit to the number of SQL databases you can
>have on one server? If I remember correctly it depends
>only on space and memory. We currently have 49 databases
>running on one server and we are continueing to grow. The
>server is running fine as far as memory goes and we have
>plenty of space but I wanted to make sure we don't have a
>limit as far as the amount of databases we are aloud on
>one server.
>.
>|||Note that the GUI tools might not be that well suited when you go above somewhere between 100 and
200 databases. Also, having an steadily increasing number of database might be an indication of
questionable design.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Shannon" <anonymous@.discussions.microsoft.com> wrote in message
news:06e701c3aeaf$a6ec9c20$a001280a@.phx.gbl...
> Is there a limit to the number of SQL databases you can
> have on one server? If I remember correctly it depends
> only on space and memory. We currently have 49 databases
> running on one server and we are continueing to grow. The
> server is running fine as far as memory goes and we have
> plenty of space but I wanted to make sure we don't have a
> limit as far as the amount of databases we are aloud on
> one server.|||Hi,
Dont worry, You can have 32767 databases per instance.
Thanks
Hari
MCDBA
"Shannon" <anonymous@.discussions.microsoft.com> wrote in message
news:06e701c3aeaf$a6ec9c20$a001280a@.phx.gbl...
> Is there a limit to the number of SQL databases you can
> have on one server? If I remember correctly it depends
> only on space and memory. We currently have 49 databases
> running on one server and we are continueing to grow. The
> server is running fine as far as memory goes and we have
> plenty of space but I wanted to make sure we don't have a
> limit as far as the amount of databases we are aloud on
> one server.