|
Hi Steve, you responded to the wrong person.
Reviewing the posts a little closer your right. But I rather doubt the OP will see your response.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hello,
For remote connections you don't need to use the port number, the port number would only be used if you don't have sql browser (this is needed if you have don't have the default instance named) not running and you are connecting to the server through an IP address.
I think what the problem would be is that you have not setup your sql server for remote connections, by default it is local only.
This can be done easily by going to the server surface area configuration, select your server and click on remote and make sure that named pipes and tcp/ip is selected.
Another check you can make is by going to the server configuration manager and sql server network configuration | select the protocol for you server and make sure that named pipes and tcp/ip is enabled.
Hope this helps,
Steve
|
|
|
|
|
In C#, the date in DateTime uses slashes ("/"). Sql uses -'s. How do I change the format in order to save dates (like DateTime.Now) in my sql database?
|
|
|
|
|
davidstern100 wrote: In C#, the date in DateTime uses slashes ("/").
It depends on your locale. A DateTime does not store dates with slashes. That is only how they are rendered in your locale.
davidstern100 wrote: How do I change the format in order to save dates (like DateTime.Now) in my sql database?
Dates are stored as SMALLDATETIME or DATETIME types, not in any specific format with dashes, slashes or whatever. It is the responsibility of the presentation layer to render the dates in a human readable form.
If you are attempting to inject a date into a SQL statement in order to make up something like this:
INSERT MyTable(SomeDate) VALUES ('2006-01-28')
then I suggest you don't. Use Parameterised queries instead.
If you tell us exactly why (in other words, to what higher purpose) you want to convert dates in this way we may be able to suggest a better solution.
|
|
|
|
|
Hi all,
I have a table named schedule which contains a col named sel_date which is a datetime.I want to display only those records which have month and year specified as parameters in a stored procedure. I want tis because i want to display records monthwise.
|
|
|
|
|
If I understand you correctly , DatePart [^] function is what your looking for:
<br />
SELECT *<br />
FROM schedule <br />
WHERE DATEPART(MONTH,sel_date) = @MonthParameter<br />
AND DATEPART(YEAR,sel_date) = @YearParameter<br />
|
|
|
|
|
Thankx a lot buddy:->!!! My problem is now solved.Thanks again
|
|
|
|
|
Hi.
I am running Windows XP Professional, and have just installed SQLServer 2000.i can set DSN in my system and access The Server.but I
need another computer to connect to the SQLServer in my system, whenever I try to connect from the remote pc via ODBC connection
it cannot connect to the database. Running netstat on my machine shows that the system is not listening to
1433/ms-sql-ms. I have checked in Network Config in SQLServer
Enterprise Manager, and TCP/IP is set to be using 1433.
so I'm pretty sure the issue is related to this 1433/ms-sql-s problem.
|
|
|
|
|
Hi,
I have installed SQL server 2005 trial.
In the connect to server dialog box of SQL server management studio,
there is no server name available in the "Server name" list.
And I cannot see any server in the browse for server window also.
I tried ping "pc_name" in SQL command prompt and was ok.
I tried using the pc_name to connect with all protocols in connect to window but nothing was working. "cannot connect to pc_name" is displayed always.
There is no service started in SQL server configuration manager's SQL server 2005 services. How to start SQL server service?
Any help would be greatly appreciated!!
Thanks & Regards,
Suman
|
|
|
|
|
Not totally sure what your issues are, but have you tried looking at the server configurations in the SQL Server Configuration Manager to verify that your server exists? This is where I would start.
Also, if you open up the sql server management studio and click cancel in connect you should have s database engine icon. If you right click on this you can create a new server. I would then go into VS2005 and connect to it. Then I would look in the properties window at the connection string.
Hope this helps.
-- modified at 15:33 Sunday 28th January, 2007
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
Hello Aaron,
Thanks a lot for your help.
But I have not yet resolved the problem.
My SQL Server Configuration Manager window looks like:
SQL Server Configuration Manager(local)
|-SQL Server 2005 Services (No icons on the right pane)
|-SQL Server 2005 Network configuration (No icons on the right pane)
|-SQL Native client configuration
|-Client Protocols(Shared Memory, TCP/IP, Named Pipes & VIA icons on the Right pane)
|-Aliases(No icons on the right pane)
How to see whether the server exist or not?
Also when I select cancel in connect window of Management Studio,
I cannot see any icon in both panes. "No Server Connection. You are not connected to a server." is there because I did not able to connect.
I am trying to fix it.
Any help would be greatly appreciated.
Thanks & Regards,
Suman
|
|
|
|
|
Hi
I'm using vb.net 2005 and I added a crystal report >>
I connected it with dataset ,,,
when I view it on CrystalReportViewer I found it empty >>
any one can help me >>
jooooo
|
|
|
|
|
|
database is sqlserver 2000
I use public sub
Public Sub GETSERVERNAMEANDDATABASENAME(ByVal rpt As Object)
Dim I As Integer
Dim TBL1 As New CrystalDecisions.Shared.TableLogOnInfo
TBL1.ConnectionInfo.ServerName = "Computer"
TBL1.ConnectionInfo.DatabaseName = "DataBaseName"
TBL1.ConnectionInfo.Password = "***"
TBL1.ConnectionInfo.UserID = "sa"
TBL1.ConnectionInfo.IntegratedSecurity = True
For I = 0 To rpt.Database.Tables.Count - 1
rpt.Database.Tables(I).ApplyLogOnInfo(TBL1)
Next I
End Sub
'I use the form which contain cystalreportviewer1
GETSERVERNAMEANDDATABASENAME(rpt)
Dim frm As New PrintFrm
frm.CrystalReportViewer1.ReportSource = rpt
frm.CrystalReportViewer1.Zoom(90%)
frm.CrystalReportViewer1.RefreshReport()
frm.Show()
thanks my friend
jooooo
|
|
|
|
|
Hi
how are you ya Bassem
I'm not professional on vb.net
i'm using the crystal report which is added with vb.net
and that function that you sent I think that it deal with the report which is designed by Crystal Report program...
jooooo
|
|
|
|
|
So you've create a VB.NET application , and then Added a report from the Add New Item dialog.Does your report have the extension of rdlc for example Report1.rdlc? If so then you are working with reports designed for Microsoft reporting Service.here is a good article [^]
|
|
|
|
|
Thanks Bassam ,, and I feel that you make alot for me >>
Bassam Saoud wrote: and then Added a report from the Add New Item dialog
yes
then I choose CrystalReport <<
the extention of the file is rpt for ex CrystalReport1.rpt..
Please try to help me
my work is stopped ..
jooooo
|
|
|
|
|
Thanks my firend >>
I found the answer, it that I must fill the dataset before view the report
jooooo
|
|
|
|
|
I used C# in VS 2k5. I think it should same with VB.Net.
fmRepGeneral viewerAdv = new fmRepGeneral(); // Form that contain CrystalReportViewer
crSPKAdv reportAdv = new crSPKAdv(); // Crystal Report file
reportAdv.SetDatabaseLogon("user", "pwd"); // Set the username/password
/*Important. This below line is giving the source of crystal report file.
dsResult = The dataset that will be used.
As I know you when you create crystal report file you should have the physical DataSet (.xsd),
then you get drag-drop the field you wanted in your CR with that physical DS, and the table's
name must same with 'dataset.Tables["must same"]'. In this case, I should have dataset that
contains Table 'V_RPT_SPK_ADV', otherwise the crystal report will never get the data.
*/
reportAdv.SetDataSource(dsResult.Tables["V_RPT_SPK_ADV"].DefaultView);
viewerAdv.crystalReportViewer1.ReportSource = reportAdv; //sure..u understand this line.
Hope this help.
Jati Indrayanto
Everything is possible.
|
|
|
|
|
Hi, I am using MS Sql Server
I have the following tables already in place, the tables are already done and the requirement is not to change any columns/tables structures. I have four tables:
1- Person: has person info, first, last, etc.
2- Departments: has the company departments names.
3- Meetings: has the meeting date, time, location, and two department names whom should participate.
4- NoShows: a log of the personId and meetingId for those who did not show up to the meeting.
I need a select query for selected meeting to show all personId and a field of F/T flag for each person whom showed up or no-show. I know how to do everything. Any comments are greatly appreciated.
Bit_Flipper
|
|
|
|
|
Bit_Flipper wrote: I know how to do everything. Any comments are greatly appreciated.
If you know how to do everything, exactly what do you want comments on?
|
|
|
|
|
I have writen a VBA Macro into MS Access 2002 database and I want tp run it from my ASP page instead to use a command button from MSAccess UserForm. I am looking for a ASP code to do that. This VBA Macro take the data from a database and export it to a MS Excel file by not only diplaying the data but also by creating a bar chart.
Khelil Khelil
|
|
|
|
|
Most people do not run Excel VBA macros from ASP pages (you would need to run OLE automation).
I wrote the following code a couple of years back that may help:
Sub WriteToExcel(objAdoResultSet, strTemplateFile, strNewFilePath)
Dim objFSO, objExcelConn, objExcelRS, arrData, lngRow, intField
'Copy the template spreadsheet, and open a recordset.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call objFSO.CopyFile(strTemplateFile, strNewFilePath, True)
Set objExcelConn = CreateObject("ADODB.Connection")
Call objExcelConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strNewFilePath & ";" & _
"Extended Properties=""Excel 8.0;HDR=NO""")
Set objExcelRS = CreateObject("ADODB.RecordSet")
Call objExcelRS.Open("SELECT * FROM [Sheet1$]", objExcelConn, _
adOpenKeyset, adLockOptimistic)
Call objExcelRS.MoveLast() 'Position cursor on formatting row.
'Write data to the spreadsheet recordset.
arrData = objAdoResultSet.GetRows()
With (objExcelRS)
For lngRow = 0 To UBound(arrData, 2)
Call .AddNew()
For intField = 0 To UBound(arrData, 1)
.Fields(intField).Value = arrData(intField, lngRow)
Next
Call .Update()
Next
End With
'Tidy up.
Call objExcelRS.Close()
Set objExcelRS = Nothing
End Sub I have simplified it a bit to make it shorter, and haven't tried running it since. The general principle is that it uses the JET driver to open a writable connection to an Excel spreadsheet, then copies the contents of the passed-in objAdoResultSet into your new connection.
Hope this helps.
Andy
|
|
|
|
|
<u></u>here is my app.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<dataConfiguration defaultDatabase="SqlConnection" />
<connectionStrings>
<add name="SqlConnection" connectionString="server=Developer;database=MSPetShop;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
first i m getting these two errors:
Message 1 Could not find schema information for the element 'dataConfiguration'.
Message 2 Could not find schema information for the attribute 'defaultDatabase'.
and when i try to call the from my DAL layer i got exception
i m using this funcion
Database db=DatabaseFactory.CreateDatabase();
I hope any one there will reply me many thanks,
adnan
|
|
|
|
|
adnanrafiq wrote: first i m getting these two errors
They are not errors they are messages (it even tells you they are messages). It means that the build process cannot verify if what you have written is valid or not.
adnanrafiq wrote: when i try to call the from my DAL layer i got exception
So, what is the exception? You've just indicated on what line you get the exception without telling us what it was.
|
|
|
|