Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all 956 articles
Browse latest View live

How to import data from URL link

$
0
0

Hi

sorry if I ask in wrong forum.

I have an idea, and hope to find a one to help me to make it real.

It is like data entry.

I have a program to store data. The data comes from requests sent by customers in web forms.

Program and Website, each one has a separate database, and a special password and user name.

The idea is making a programe "connecter" to drog and drop link inside it, and the connecter login in Website to copy the information from requst form, then logon in the Data Programe to paste it.

hope my idea was clear.


How to store the selected values of a group of check boxes in to database using asp.net (c#)

$
0
0

hi,

How to store the selected values of a group of check boxes in to database using asp.net (c#). 

Eg: storing the hobbies selected by the user while registering, in to database.

--bdhkrl.

WCF Service to ObjectDataSource fast for GridView and 30 seconds slower for RDLC

$
0
0

I have an asp page with an objectdatasource getting data from a WCF Service. The web service returns a datatable. I compared the speed of data presentation in a gridview and in a RDLC with the reportviewer web control in local mode. The differences are 20 to 30 seconds slower with the RDLC.

The problem occurs in a VS2012 Express with a ReportViewer 2012 distribution package added. I was wondering if it is because of the environment, so I tested the same setup in a VS2008 enterprise with BI installed. Surely in VS2008 the RDLC with an ObjectDataSource which uses a web service reference, renders perfectly fine and return within a second.

I did not have any code behind in both scenarios with all default properties. Is there something I should setup programmatically instead? What can be done to speed the RDLC rendering up? Please advise.

<asp:GridView ID="GridView1" runat="server"DataSourceID="WCFServiceObjectDataSource"></asp:GridView><rsweb:ReportViewer ID="LabReportViewer" runat="server"><LocalReportReportPath="BETA.rdlc"><DataSources><rsweb:ReportDataSourceDataSourceId="WCFServiceObjectDataSource"Name="NAME"/></DataSources></LocalReport></rsweb:ReportViewer><asp:ObjectDataSource ID="WCFServiceObjectDataSource" runat="server"SelectMethod="GetResults"TypeName="WebApplication.ResultsServiceReference.ResultsServiceClient"><SelectParameters><asp:QueryStringParameterName="ID"QueryStringField="id"Type="String"/></SelectParameters></asp:ObjectDataSource>

MVC Music store issue

$
0
0

Hello community :)

I was following http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-4 this tutorial, and got struck there. I was doing everything as in tut, but my database for genres is empty. When i click "Store" i shows me that has 0 genres. What could cause the issue ? Here are some ss of code that might help you.

http://pokit.org/get/?bbd76b8a7d9338ab7f2630fca956ff94.png

http://pokit.org/get/?878eabbc97fda452a4d130250def487b.png

http://pokit.org/get/?8e5a6a2461d967f3753e522b2a68e5dd.png

http://pokit.org/get/?5457f56d46ee42df84171d83eeb12d0f.png

http://pokit.org/get/?5dddd0b4eb2fdc9b28e6069afb544b53.png

ListView and EntityDataSource - Display multiple tables from model

$
0
0

I am new to ASP.NET and Entity Framework. I have been looking around for good examples but I can't find any. I finally decided to ask a question as my last resort. I am hoping that someone here can help me with my problem.

I think the solution is there, but I just can't see it. I need to display 4 tables from an Entity Framework model in a ListView.

The model has a main table called systemUser with some basic information (userId,userFirstName, userLastName, userEmail). All of the tables have a userId. The userId is what connects all 4 tables. When I insert information I need to simultaneously insert into all 4 tables using the same userId. 

The tables are as follows:

systemUser:

userId: int

userFirstName: varchar(255)

userLastName: varchar(255)

userEmail: varchar(255)

mobileSystemUsers:

userId: int

mobilePassword: int

companyAccess:

Dev: bit

isEnabled: bit

userId: int

moduleAccess:

accounting: nvarchar(2)

sales: nvarchar(2)

shipping: nvarvhar(2)

When I display data I need to have something like the following:

userId  || userFirstName || (all of systemUser) || mobilePassword || VMC || (all of companyAccess) || (moduleAccess data)

A new systemUser should have all of the information filled out in the systemUser page. The other information can exist or be null. 

I am using an entitydatasource. This is the first time I use it. I was able to implement this functionality using a GridView and an SQLdatasource but I need to implement this using ListView and entitydatasource. 

When I configure the entitydatasource I am only able to select one table. 

I also need to perform basic CRUD operations accross all tables at once. 

How can I display all of the information from the tables in the manner that I want? 

Insert data from excel file

$
0
0
i want to give user option to upload a excel file and after that data is store in particular table how can i do this.

Invalid value for key 'attachdbfilename'

$
0
0

My project my db in  app_data folder db name is test.mdf

and my connection string is

<add name="realestate"  connectionString="Data Source= ftpIP;Network Library=DBMSSOCN;user id=ftpuser;password=ftppassword; AttachDbFilename= |DataDirectory|Test.mdf; Integrated Security = false;" />
    <add name="ConnectionString" connectionString="Data Source=ftpIP;Network Library=DBMSSOCN;user id=ftpuser;password=ftppassword;AttachDbFilename=|DataDirectory|Test.mdf;Integrated Security=False;"
      providerName="System.Data.SqlClient" />

 

when i run my application that give me error

 Invalid value for key 'attachdbfilename'

 

using objectdatasource for radgrid

$
0
0

i have a scenario for binding huge nos of data to a radgrid , this doesn't even run in production server, also while paging it fetches all the record, in case if i use objectdatasource datasource for radgrid can i avoid postback to server ?

also if their is any way to optimize kindly advise

<div class="row" style="width: 800px; text-align: right;">Edit  Abuse</div>

Can we show Filterexpressions values in URL to filter Listview data

$
0
0

Hi Guys

               I have situation. I have to create a webpage with following output.

1) One listview having more than 10 Lakh records.  ( I can bind with database no help required)

2) There are three dropdowns to filter records from the listview  which are also corespondand to each other like 

DropdownCounty=>DropdownState=>DropDownCity.

Current status: I have binded all the three dropdowns with database and also binded listview and created entire functionality of filtering data using EntityFramework. 

Problem: It takes long time to filter data as on every dropdownlist Selected index change event data is rebinded to listview.


Help required: I am searching for the faster way and found FilterExpressiontechnique. I have applied to my code and every things are working fine (Databinding ... filtering). and it is also faster than  my first approach.

Actuall problem: My actuall problem is that I want to show my FilterExprerssion parameters in URL. Likewww.abc.com/US filter US based records. www.abc.com/US/NewYork will filter US and newyork based records.   

I have followed this thread: http://forums.asp.net/t/1367899.aspx?I+need+help+Filter+Data+in+Listview+using+a+Dropdown+list

Thanks for your Precious time

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

$
0
0

Hi,

 I am having such a problem. I have SQL Express installed on the windows 2003 server and originally I installed instance1 of SQL Server 2005. When I installed Instance1, I remember having problems with remotely connecting to that instance1, but somehow I fixed it. Now I installed instance2 and I started having remote connection issues again with that instance2. I am able to connect to instance1 but not instance2. I checked settings for both instances and they look identical.

I turned firewall off for now. I checked TCP settings using surface area configuration (allowing both local and remote connections). I turned off VIA protocol. I specified TCP properties to use dynamic port for that instance2.

In the sql native client configuration I have the following order#: 1. Shared memory, 2. tcp, 3. np, 4. VIA(Disabled). TCP is configured to use 1433.

 I have no clue about what is going on. Sometimes I am able to connect remotely and sometimes I get the following error:

 "A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)."

When I connect locally - everything connects fine. File sharing is also checked, it works etc...

 Thanks for help!!!

GK

 I just noticed that I was able to connect from different computer on the different network.

Join tables from two datasources display results in gridview

$
0
0

Have a Sql datasource named "sqldata" and a ODBC datasource named "CEdata" definded in web.config

"Sqldata" contains table "TimesheetHeader" with the fields: ID, Jobnum, Date

"CEdata" contains table "jcjob" with the fields:  Jobnumber, Jobname

I want a gridview to list  The ID (from sqldata.TimesheetHeader) , Date (from sqldata.TimesheetHeader) and jobname ( from the CEdata.jcjob datasource based on common "Jobnum" key)

I've tried with VS designer, but it seems it will only give me access to one datasource.  I'm thinking perhaps there is some way in VB to join the two into one?

So, How can I join the two datasets together via the common "jobnum" key and report results?

Thanks in advance for your help!

grid view searching

$
0
0

Hi,

I have a employee Data Table with eid,empname,empaccountnumber,empsalary.

I am binding all the records to a gridview.

I have to filter Records using a textbox.

the textbox value should search all (eid,empname,empaccountnumber,empsalary).

no button should be used.

Please guide me with suggestions or links.

Thanks.

When to use Trusted_Connection is equal to False

$
0
0

Can someone guide me when to use the trusted_connection=false; in the connection string.

Populate a gridview based on a dropdownlist value

$
0
0

Hi guys, I'm new to ASP.Net. I'm building a page which consists of a dropdownlist, and a gridview below the dropdownlist. I want to populate the gridview based on the values selected from the dropdownlist. I wrote a stored procedure to concatenate two dates. The dates were saved as nvarchar(100) in table CC_DateRanges in a field named DateRange. I created SqlDataSourceDropdownlist to populate the dropdownlist named ddlDateRange using the table CC_DateRanges. I then bounded the dropdownlist to the SqlDataSourceDropDownList. I added SqlDataSourceGridView and configured it with a stored procedure named usp_Payments. The latter has two parameters named @beginDateAND @endDate. The DataSource wizard detected the two parameters in my select statement so I set the Parameter Source to control and the ControlID to ddlDateRanges. I wrote a method namedSplitComboStrings() to split the string in the ddl. I then saved the dates in two datetime variables named firstDate and endDate. I am called the SplitComboStrings method from the ddlDateRanges_SelectedIndexChanged event. In the DataSource wizard I tried to assign @beginDate to firstDate and @endDate to secondDate but when I run the app I receive the following error: Server Error in '/' Application. [FormatException: String was not recognized as a valid DateTime.] .

Your kind assistance would be appreciated.

Server Error in '/' Application.


String was not recognized as a valid DateTime.

             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.FormatException: String was not recognized as a valid DateTime.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
                  

Stack Trace:

[FormatException: String was not recognized as a valid DateTime.]
   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +10841066
   System.Convert.ToDateTime(String value, IFormatProvider provider) +72
   System.String.System.IConvertible.ToDateTime(IFormatProvider provider) +10
   System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +519
   System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +126
   System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, DbType dbType, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +57
   System.Web.UI.WebControls.Parameter.GetValue(Object value, Boolean ignoreNullableTypeChanges) +120
   System.Web.UI.WebControls.Parameter.get_ParameterValue() +40
   System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +247
   System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand command, ParameterCollection parameters, IDictionary exclusionList) +257
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +589
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +105
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
   System.Web.UI.Control.EnsureChildControls() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
                  


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446                 

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PRO_ADMIN_WEB
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        DateTime firstDate, secondDate;     

        protected virtual void OnPreLoad(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ConnectionStringSettings connObject = ConfigurationManager.ConnectionStrings["PRO_ADMIN_WEBConnectionString"];

                    using (SqlConnection conn = new SqlConnection(connObject.ConnectionString))
                    {
                        using (SqlCommand comm = conn.CreateCommand())
                        {
                            comm.CommandType = CommandType.StoredProcedure;
                            comm.CommandText = "usp_getDateranges";
                            conn.Open();
                            comm.ExecuteNonQuery();
                        }
                    }
                }
            }
            catch (SqlException ex)
            {
                Response.Write(ex.Message);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ddlDateRanges_SelectedIndexChanged(object sender, EventArgs e)
        {
            SplitComboStrings();
        }

        private void SplitComboStrings()
        {
            try
            {
                string text = ddlDateRanges.SelectedItem.ToString();
                firstDate = Convert.ToDateTime(text.Substring(0, 10));
                secondDate = Convert.ToDateTime(text.Substring(13, 10));
            }
            catch (SqlException ex)
            {
                Response.Write(ex.Message);
            }

        }
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="PRO_ADMIN_WEB.WebForm2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><table><tr><td><asp:DropDownList ID="ddlDateRanges" Width="228px" runat="server" 
                AutoPostBack="True" DataSourceID="SqlDataSourceDropDownList" 
                DataTextField="DateRange" DataValueField="PK_DateRangeID" 
                onselectedindexchanged="ddlDateRanges_SelectedIndexChanged"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSourceDropDownList" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PRO_ADMIN_WEBConnectionString %>" 
                SelectCommand="SELECT [PK_DateRangeID], [DateRange] FROM [CC_DateRanges]"></asp:SqlDataSource></td></tr><tr><td colspan="3"><asp:GridView ID="GridView1" Height="64px" Width="1430px" runat="server" 
                AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                DataKeyNames="ID" DataSourceID="SqlDataSourceGridView"><Columns><asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="ID" /><asp:BoundField DataField="Account Number" HeaderText="Account Number" 
                        SortExpression="Account Number" ReadOnly="False"/><asp:BoundField DataField="Client" HeaderText="Client" 
                        SortExpression="Client" ReadOnly="False"/><asp:BoundField DataField="Payment Date" HeaderText="Payment Date" 
                        SortExpression="Payment Date" ReadOnly="False"/><asp:BoundField DataField="Payment Amount" HeaderText="Payment Amount" 
                        SortExpression="Payment Amount" ReadOnly="False"/><asp:BoundField DataField="Collection Commission" 
                        HeaderText="Collection Commission" SortExpression="Collection Commission" 
                        ReadOnly="False"/><asp:BoundField DataField="Invoice Description" HeaderText="Invoice Description" 
                        SortExpression="Invoice Description" ReadOnly="False"/></Columns></asp:GridView><asp:SqlDataSource ID="SqlDataSourceGridView" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PRO_ADMIN_WEBConnectionString %>" 
                SelectCommand="usp_Payments" SelectCommandType="StoredProcedure"><SelectParameters><asp:ControlParameter ControlID="ddlDateRanges" 
                        Name="beginDate" PropertyName="SelectedValue" DbType="DateTime" 
                        DefaultValue=""/><asp:ControlParameter ControlID="ddlDateRanges" Name="endDate" 
                        PropertyName="SelectedValue" DbType="DateTime" DefaultValue="" /></SelectParameters></asp:SqlDataSource><br /></td></tr></table></div></form></body></html>



Roles.AddUserToRole causes connection error

$
0
0

Hello, my application runs just fine on local host, when I run it on the server, it all works fine. I am able to login and create a new user, but when try to add a user to a role (with Roles.AddUserToRole) I get the following error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

 My connection string looks like this:

<add name="MyDB" connectionString="Data Source=xx.xxx.xx.xxx;Database=ASPNETDB;User ID=sa;Password=xxxx"/>

I am running Windows 2008 Server and IIS7.

Where do I find the instance name and where do I place it in my connectionString? or is this even the error?

 Please help,

 Thank you,

 Louis


Data Convertion

$
0
0

Hello guys, this is my first time here as a member.

I'm facing a problem now with my application, in which I want to search in a MS-SQL DB, through a select storage procedure, some informations from a table.

The problem is: In the Asp.Net app, when I try to use the Datasource Form Parameter to filter 2 dates, there is a different date format between the MS-SQL and the input box (with JS) which I am using, so I can't filter anything.

Do you have an ideia on how should I do it? Should execute the procedure through C# coding?

App format: dd/MM/yyyy

MS-SQL format: yyyy-MM-dd

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:connectionStr %>" SelectCommand="SP_SEARCH" SelectCommandType="StoredProcedure"><SelectParameters><asp:FormParameter DefaultValue="01/01/2014" FormField="datepick" Name="date1" Type="DateTime" /><asp:FormParameter DefaultValue="01/01/2015" FormField="datepick2" Name="date2" Type="DateTime" /></SelectParameters></asp:SqlDataSource>

Error Help: There is already an open DataReader associated with this Command which must be closed first.

$
0
0

 

I'm having this error in this part of the code and I'm still unable to figure out a solution for it

 Error stats:

There is already an open DataReader associated with this Command which must be closed first.ExecuteReader requires an open and available Connection.

 

Line 144: .CommandType = CommandType.Text

 Line 145: .Connection = cn

 Line 146: dr = .ExecuteReader

 Line 147: End With

 Line 148 :

 

 

 

 

 The code is:

 

 Public Function GetDBField(ByVal Query As String, ByVal Field As String) As String

 'abriendo la conexion a la base de datos

 SqlConnect()

 Dim cmd As New SqlCommand  Dim result As String = ""

 Dim dr As SqlDataReader  dr = Nothing

 'ejecutando el lector de DO  Try

 With

cmd  .CommandText = Query

 .CommandType = CommandType.Text

 .Connection = cn  dr = .ExecuteReader  

End With

 

 Catch ex As SqlException  ShowAlertMessage(ex.Message)  GetDBField = Nothing  Exit Function  End Try

 'Escribiendo en una Variable de texto  Try  If dr.HasRows Then

 End If  While dr.Read  If IsDBNull(dr(Field).ToString) = True Then  result = Nothing  Else  result = dr(Field).ToString  End If  End While  Catch ex As SqlException  ShowAlertMessage(ex.Message)  GetDBField = Nothing  Exit Function

 End Try

 'Cerrando la conexion de BD  SqlDisconnect()

 GetDBField = result  End Function Really in need of any kind of help

 

 

Global Variables

 

#Region " Variables Globales"  Public db As String = "repuestosdr"

 'Public CnStr As String = "Driver={SQL Server Native Client 10.0};Server=localhost;Database=" & db & ";Uid=crivera;Pwd=crivera;"  Public CnStr As String = ConfigurationManager.ConnectionStrings("SuoodConnection").ConnectionString '"Driver={SQL Server};Server=repuestosdr.db.10580944.hostedresource.com;Database="& db & ";Uid=" & db & ";Pwd=r34llyH4rd!;Port=1433;"

 Public Logged As Boolean = False

 Public Qry As String  Public msg As New MsgBoxResult

 Public ds As New DataSet  Public dt As New DataTable  Public dr As SqlDataReader  Public cn As New SqlConnection()  Public da As New SqlDataAdapter  Public cmd As SqlCommand

 #End Region for connection:

 

 

Connections

 

#Region " Connection"  Public Function SqlConnect(Optional ByVal MyPage As Page = Nothing) As Boolean

 

 Try

  If cn.State = ConnectionState.Closed Then  

With

cn  .ConnectionString = CnStr  .Open()

  End With  

End If

 Catch myerror As Exception  ShowAlertMessage("Error Connecting to the Database" & Chr(13) & myerror.Message)

 SqlConnect = False

 End Try  

SqlConnect = True  

End Function  

 

 

 

 

 Really in need of any kind of help.

 

How to implement update function!

$
0
0

The following is some info that I received from an earlier post!(Mikes.Nett) Can someone help me to revise this code so that I can connect to my database. I am limited in my understanding of how to make this savePersonell method interact with the information that I am trying to access! The use of ids is something that I am not familair with so I need help to build my base of knowledge on this subject. Should I be intializing  save personell data with numbers to index the ids, and if so can you explain how this should be done??? Thanks, Markus33

(Mikes.Nett) Your data layer has some basic mistakes. You should be using parameters instead of concatenating variables directly into a SQL statement. Also, you should use @@Identity to get the most recently created record - not MAX(Id). Also, why are you inserting a record and then updating it? You can do the whole thing with one insert.

Here's a revised version that uses parameters and also takes an additional argument - a nullable int representing the ID of the record to be "saved". If you are updating an existing record, you pass a value in for hte int and the UPDATE statement is executed. If you are creating a new record, you pass null in and the INSERT statement is executed instead. Mikes.net

publicstaticboolSavePersonnel(stringDatabase,stringFirstName,stringLastName,stringPayRate,stringStartDate,stringEndDate,int?Id){try{using(OleDbConnection conn =newOleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source="+Database)){
	    conn.Open();OleDbCommand command = conn.CreateCommand();
            command.Parameters.AddWithValue("FirstName",FirstName);
            command.Parameters.AddWithValue("LastName",LastName);
            command.Parameters.AddWithValue("PayRate",PayRate);
            command.Parameters.AddWithValue("StartDate",StartDate);
            command.Parameters.AddWithValue("EndDate",EndDate);string strSQL;if(!Id.HasValue)// inserting a new record{
                strSQL ="Insert into tblPersonnel (FirstName, LastName, PayRate, StartDate, EndDate) values (?,?,?,?,?)";}else// updating existing record{
                strSQL ="Update tblPersonnel Set FirstName = ?, LastName = ?, PayRate = ?, StartDate = ?, EndDate = ? Where ID = ?";
                command.Parameters.AddWithValue("ID", ID);}
            command.CommandText= strSQL;
            command.ExecuteNonQuery();returntrue;}}catch(Exception ex){returnfalse;}}

How do I configurate a calendar on ASP.NET in C# with SQL?

$
0
0

Hi, I'm glad to join this forum Big Grin | :-D 
 
I've a few questions...
 
I'm learning ASP.NET and C# and I've a project in which I've to make a management system of work employed.
 
I want to make a calendar in which workpeople need to select days and specify the work that they have done every hour.
 
My idea is click on days, and show a menu with all the hours and a dropdown with the types of work that I've registered on my SQL database.
 
If a day hasn't been filled, it will be red, if it's incomplete yellow, and if it's completely filled with all the hours, in green.
 
Every employer has his own login session, and have to fill the management system.
 
I know that it's a little bit complicated, I don't know much at programming and my english isn't very well, but If you know how to arrange me, or how to make this, I will be very grateful.
 
It's not neccesary to explain step by step where I have to click, but I need to know how it's made and which properties, controls and features I've to use.
 
Thank all of you!

Is this possible to do with a sqldatasource?

$
0
0

I do have a data source code that look like this

<asp:SqlDataSource ID="AdBox_SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MainWebConnection %>"
        SelectCommand="SELECT DISTINCT [TCompanyName], [ImageUrl], [NavigateUrl], [Keyword], [TEnterDate], [TDoHavePic] FROM [AdList] WHERE (([TDoHavePic] = @TDoHavePic) AND ([Keyword] = @Keyword)) ORDER BY [TEnterDate]" OnSelecting="AdBox_SqlDataSource_Selecting"><SelectParameters><asp:Parameter DefaultValue="YesPic" Name="TDoHavePic" Type="String" /><asp:Parameter DefaultValue="Ad Box" Name="Keyword" Type="String" /></SelectParameters></asp:SqlDataSource>

I would like to know if there is a way to get the result of this Select Command and save it to a Data Reader in the code behind like this:

 Dim reader As SqlDataReader = "Result from database search go here"

Thanks

Viewing all 956 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>