An example will be very handy..
Thxsql
An example will be very handy..
Thxsql
i have a textbox which a user enters a numeric value
i want it to use SqlDataSource and check if the value exists in any of the tables.
in my text box the users would enter starting from '100000' or '200000'
i want it to check the view that starts the # with '100000' and 2ed view starts '200000'
With this i can check in one of the tables and make the selection.
<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:imacstestConnectionString %>"
SelectCommand="SELECT [ReportNumber] FROM [AppraisalSummaryBlue] WHERE ([ReportNumber] = @.ReportNumber)">
<SelectParameters>
<asp:ControlParameterControlID="txtReport"Name="ReportNumber"PropertyName="Text"
Type="String"/>
</SelectParameters>
</asp:SqlDataSource>
How can i make this possible ?
i was thinking putting a second sqldatasource and have that check the second view but how can i make the textbox goto the correct selectcommand ?
You'll need to do a conditional if in your select command:
IF @.ReportNumber > 10000 BEGINSELECT [ReportNumber] FROM [AppraisalSummaryBlue] WHERE ([ReportNumber] = @.ReportNumber) END ELSE BEGINSELECT [ReportNumber] FROM [AppraisalSummaryTHEOTHERTABLE] WHERE ([ReportNumber] = @.ReportNumber) END
obscurrHi,
If you're using Query Analyzer, it truncates output at 255 characters.
Don't worry about it, the output is all there. Tricky microsofties.
-- Louis|||But if I want to put it in a textarea on my php page, the whole thing
doesn't show. How am I able to do that?
obscurr
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||louisducnguyen@.hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0311220909.67236875@.posting.google.com>...
> Hi,
> If you're using Query Analyzer, it truncates output at 255 characters.
> Don't worry about it, the output is all there. Tricky microsofties.
> -- Louis
If that is your issue, you can increase the number of characters
displayed in QA, to a maximum of 8192 (Tools - Options - Results).
Simon
I am trying to retrieve data that has been inserted into the database but only half the text is being displayed.
The field is varchar(8000)
In the Enterprise Manager I can view the data, then I copy and paste it into MS Word and everything is there.
851 Characters with spaces.
However, when I enter the SQL code into SQL Query Analyzer only half the text shows, about 257 characters are displayed with spaces.
When I display the information on the webpage only half the text is displayed (running IIS/PHP 5)
I don't know why this is doing this and not sure what I can do to display the full text.
Please help.
This is Query Analyser setting...
In QA window go to Tools -- Options -- Select "Result" tab -- Change "Maximum Charater Per Column " to whatever setting u want
Madhu
|||Thanks, this resolves the first part of my question however, when I display the information on the web it is still being truncated. If there are any ideas that would be great. Thanks!|||
check the variable size if any ... it may be used as Varchar (4000)
Madhu
i read a thread here which is similar to what i am trying to do but it was in xml format..
hope someone anwers me...i really need help!
thanks!
I'm not sure what the difference is between the thread you mentioned and what you want to do. I would expect that the challenging thing is to retrieve the fields that were just saved. Once you have the information, changing it to the appropriate format is potentially tedious, but not difficult.
Do you have a reference to the thread?
. Your XML is not a well-formed XML document.I have a table in a SQL Server database that contains a field(data type image) that contains a text file. I'm trying to retrieve this file and save it onto the hard drive. I'm using the code below, but get I get the error 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.' at line 11. This code worked fine when I tested it on the pubs database and exporting the logo field out of pub_info. I'm not quite sure why this doesn't work for my database. Can anyone see where I'm going wrong?
1 Dim cn As ADODB.Connection
2 Dim rs As ADODB.Recordset
3 Dim mstream As ADODB.Stream
4 cn = New ADODB.Connection
5 cn.Open("Provider=SQLOLEDB;data Source=server;Initial Catalog=database;User Id='userid';Password='password'")
6 rs = New ADODB.Recordset
7 rs.Open("Select * from filesubmissions where bundleId = 'F0000014.bun'", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
8 mstream = New ADODB.Stream
9 mstream.Type = ADODB.StreamTypeEnum.adTypeBinary
10 mstream.Open()
11 mstream.Write(rs.Fields("BLOB").Value)
12 mstream.SaveToFile("c:\export.txt", ADODB.SaveOptionsEnum.adSaveCreateOverWrite)
13 rs.Close()
14 cn.Close()
Thanks
May I suggest you start by using ado.net?
|||try this one...
Dim BlobQuery As String
Dim RG As New Random
Dim InvoiceCSVData As Byte()
Dim strFileName As String = "TestingCSV_" + TextBox1.Text + "_" + CStr(RG.Next(1, 100000)) + ".CSV"
BlobQuery = "select BLOB from YourTableName where Condition'"
myOraConnection.Open()
myOraCmd = New OracleCommand(BlobQuery, myOraConnection)
myDR = myOraCmd.ExecuteReader(CommandBehavior.SequentialAccess)
myDR.Read()
InvoiceCSVData = CType(myDR(0), Byte())
myDR.Close()
myOraConnection.Close()
Response.AddHeader("Content-disposition", _
"attachment; filename=" & strFileName)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(InvoiceCSVData)
Response.End()
Message.Innerhtml=MyDataset.tables(0).Rows(0)(12)
I would expect this to come up with a 1 or a 0. I get S00817 if the database record holds a 1 or a 0. So what is going on here?You're not selecting what you think you're selecting. You will get a 1 or 0 back, not S00817. Do any of the fields in the record have that value? If you miss a comma in your field list, you can get goofy-looking, unexpected data. Also, when the bit comes back, you can feed it right into boolean properties. You don't have to change 1 into true, for example. Pretty handy. I'd run your SQL statement in Query Analyzer, some where outside of ASP. Actually, ADO might convert the 1 to -1. Might want to check that also. Check your query; something's up there I would suspect.|||Yes you were quite right. I was trying to read data from another field. I should have using Mydataset.tables(0).Rows(0)(13)
Thank you for your help